diff options
author | Christoph Gysin <christoph.gysin@gmail.com> | 2015-11-28 16:18:46 +0200 |
---|---|---|
committer | Christoph Gysin <christoph.gysin@gmail.com> | 2015-11-28 23:50:44 +0200 |
commit | bf97a5ada5ea4f8b45d15d00dc7f21487af8eadc (patch) | |
tree | 5227d68b8173b7a4e747c602741ecfcf653c5fde /swaymsg | |
parent | 12c8cf5bf6dd0d0e77ff78260b603cdaa1731a65 (diff) |
swaymsg: Add --help option that prints usage
Diffstat (limited to 'swaymsg')
-rw-r--r-- | swaymsg/main.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/swaymsg/main.c b/swaymsg/main.c index 2f2e843a..8f91dc55 100644 --- a/swaymsg/main.c +++ b/swaymsg/main.c @@ -23,6 +23,7 @@ int main(int argc, char **argv) { init_log(L_INFO); static struct option long_options[] = { + {"help", no_argument, NULL, 'h'}, {"quiet", no_argument, &quiet, 'q'}, {"version", no_argument, NULL, 'v'}, {"socket", required_argument, NULL, 's'}, @@ -33,6 +34,7 @@ int main(int argc, char **argv) { const char *usage = "Usage: swaymsg [options] [message]\n" "\n" + " -h, --help Show help message and quit.\n" " -q, --quiet Be quiet.\n" " -v, --version Show the version number and quit.\n" " -s, --socket <socket> Use the specified socket.\n" @@ -41,7 +43,7 @@ int main(int argc, char **argv) { int c; while (1) { int option_index = 0; - c = getopt_long(argc, argv, "qvs:t:", long_options, &option_index); + c = getopt_long(argc, argv, "hqvs:t:", long_options, &option_index); if (c == -1) { break; } |