aboutsummaryrefslogtreecommitdiff
path: root/swaygrab
diff options
context:
space:
mode:
authorChristoph Gysin <christoph.gysin@gmail.com>2015-11-28 16:18:54 +0200
committerChristoph Gysin <christoph.gysin@gmail.com>2015-11-28 23:50:44 +0200
commit12c8cf5bf6dd0d0e77ff78260b603cdaa1731a65 (patch)
tree07ebb7a69fe52870adf2181c31fe3dc764a0eea7 /swaygrab
parent2f2e1f3fc710982fd8577091c344af19ac736d2f (diff)
downloadsway-12c8cf5bf6dd0d0e77ff78260b603cdaa1731a65.tar.xz
swaygrab: Add --help option that prints usage
Diffstat (limited to 'swaygrab')
-rw-r--r--swaygrab/main.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/swaygrab/main.c b/swaygrab/main.c
index 90d118e2..ae17155f 100644
--- a/swaygrab/main.c
+++ b/swaygrab/main.c
@@ -127,6 +127,7 @@ int main(int argc, char **argv) {
init_log(L_INFO);
static struct option long_options[] = {
+ {"help", no_argument, NULL, 'h'},
{"capture", no_argument, &capture, 'c'},
{"version", no_argument, NULL, 'v'},
{"socket", required_argument, NULL, 's'},
@@ -138,6 +139,7 @@ int main(int argc, char **argv) {
const char *usage =
"Usage: swaygrab [options] <output> [file]\n"
"\n"
+ " -h, --help Show help message and quit.\n"
" -c, --capture Capture video.\n"
" -v, --version Show the version number and quit.\n"
" -s, --socket <socket> Use the specified socket.\n"
@@ -147,7 +149,7 @@ int main(int argc, char **argv) {
int c;
while (1) {
int option_index = 0;
- c = getopt_long(argc, argv, "cvs:r", long_options, &option_index);
+ c = getopt_long(argc, argv, "hcvs:r", long_options, &option_index);
if (c == -1) {
break;
}