diff options
author | Benno Schulenberg <bensberg@justemail.net> | 2013-08-29 12:18:20 +0200 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2013-08-30 09:18:22 +1000 |
commit | cd14edbc245ca7a34c6a7143ac40014a5bede217 (patch) | |
tree | c1eff1c8d59ff9c19e86fa39cdbc47bb62af7d4f /setxkbmap.c | |
parent | f5ffd59830ff5f4a4f337d56e7e8b4a1930a46e8 (diff) |
Printing the program's version number on -version.
Also unwrap a help-text line, as it looks neater and stays within
80 characters, and alphabetize the -help option in the man page.
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
[squashed in: include "config.h" directive]
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Diffstat (limited to 'setxkbmap.c')
-rw-r--r-- | setxkbmap.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/setxkbmap.c b/setxkbmap.c index 070f12b..cf0f02d 100644 --- a/setxkbmap.c +++ b/setxkbmap.c @@ -24,6 +24,9 @@ ********************************************************/ +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif #include <stdio.h> #include <stdlib.h> #include <locale.h> @@ -257,8 +260,8 @@ usage(int argc, char **argv) " -symbols <name> Specifies symbols component name\n" " -synch Synchronize request with X server\n" " -types <name> Specifies types component name\n" - " -v[erbose] [<lvl>] Sets verbosity (1..10). Higher values yield\n" - " more messages\n" + " -v[erbose] [<lvl>] Sets verbosity (1..10); higher values yield more messages\n" + " -version Print the program's version number\n" " -variant <name> Specifies layout variant used to choose component names\n", argv[0] ); @@ -472,6 +475,11 @@ parseArgs(int argc, char **argv) synch = True; else if (streq(argv[i], "-types")) ok = setOptString(&i, argc, argv, &settings.types, FROM_CMD_LINE); + else if (streq(argv[i], "-version")) + { + MSG1("setxkbmap %s\n", PACKAGE_VERSION); + exit(0); + } else if (streq(argv[i], "-verbose") || (streq(argv[i], "-v"))) { if ((i < argc - 1) && (isdigit(argv[i + 1][0]))) |