diff options
author | Christoph Gysin <christoph.gysin@gmail.com> | 2015-11-28 16:09:14 +0200 |
---|---|---|
committer | Christoph Gysin <christoph.gysin@gmail.com> | 2015-11-28 23:50:44 +0200 |
commit | b235ccd212920db7e444716b7a36fcb4a36a3644 (patch) | |
tree | 8061a7ee4e4ad1f3b2bff465df6dc8bab447adea /swaygrab/main.c | |
parent | e48a16ce5ec0719f9f119ad5fb5891081e5e6dcd (diff) |
swaygrab: Print usage and exit on unknown options
Diffstat (limited to 'swaygrab/main.c')
-rw-r--r-- | swaygrab/main.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/swaygrab/main.c b/swaygrab/main.c index e60d154f..90d118e2 100644 --- a/swaygrab/main.c +++ b/swaygrab/main.c @@ -135,6 +135,15 @@ int main(int argc, char **argv) { {0, 0, 0, 0} }; + const char *usage = + "Usage: swaygrab [options] <output> [file]\n" + "\n" + " -c, --capture Capture video.\n" + " -v, --version Show the version number and quit.\n" + " -s, --socket <socket> Use the specified socket.\n" + " -R, --rate <rate> Specify framerate (default: 30)\n" + " -r, --raw Write raw rgba data to stdout.\n"; + int c; while (1) { int option_index = 0; @@ -165,6 +174,9 @@ int main(int argc, char **argv) { #endif exit(EXIT_SUCCESS); break; + default: + fprintf(stderr, "%s", usage); + exit(EXIT_FAILURE); } } |