From cd14edbc245ca7a34c6a7143ac40014a5bede217 Mon Sep 17 00:00:00 2001 From: Benno Schulenberg Date: Thu, 29 Aug 2013 12:18:20 +0200 Subject: 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 Reviewed-by: Peter Hutterer [squashed in: include "config.h" directive] Signed-off-by: Peter Hutterer --- man/setxkbmap.man | 9 ++++++--- setxkbmap.c | 12 ++++++++++-- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/man/setxkbmap.man b/man/setxkbmap.man index d002cb2..cf23d6f 100644 --- a/man/setxkbmap.man +++ b/man/setxkbmap.man @@ -24,9 +24,6 @@ only as needed. The source for all of the components can be found in .IR __xkbconfigroot__ . .SH OPTIONS .TP 8 -.B \-help -Prints a message describing the valid input to \fIsetxkbmap\fP. -.TP 8 .B \-compat \fIname\fP Specifies the name of the compatibility map component used to construct a keyboard layout. @@ -47,6 +44,9 @@ Specifies the display to be updated with the new keyboard layout. Specifies the name of the geometry component used to construct a keyboard layout. .TP 8 +.B \-help +Prints a message describing the valid input to \fIsetxkbmap\fP. +.TP 8 .B \-I \fIdirectory\fP Adds a directory to the list of directories to be used to search for specified layout or rules files. @@ -116,6 +116,9 @@ Specifies level of verbosity in output messages. Valid levels range from 0 (least verbose) to 10 (most verbose). The default verbosity level is 5. If no level is specified, each \fI-v\fP or \fI-verbose\fP flag raises the level by 1. +.TP 8 +.B \-version +Prints the program's version number. .SH USING WITH xkbcomp If you have an Xserver and a client shell running on different computers and XKB configuration files on those machines are different you can get 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 #include #include @@ -257,8 +260,8 @@ usage(int argc, char **argv) " -symbols Specifies symbols component name\n" " -synch Synchronize request with X server\n" " -types Specifies types component name\n" - " -v[erbose] [] Sets verbosity (1..10). Higher values yield\n" - " more messages\n" + " -v[erbose] [] Sets verbosity (1..10); higher values yield more messages\n" + " -version Print the program's version number\n" " -variant 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]))) -- cgit v1.2.3