diff options
author | Alan Coopersmith <alan.coopersmith@oracle.com> | 2013-01-12 22:00:30 -0800 |
---|---|---|
committer | Alan Coopersmith <alan.coopersmith@oracle.com> | 2013-01-12 22:10:53 -0800 |
commit | 10105c373b973ef73b8ab19ee62fc152b7230da2 (patch) | |
tree | 52a35b4b8824d6520d2fa5059b2e9e362dbb8972 | |
parent | 5a4bb361aa2247c552f807f162a9fd0e60305ec4 (diff) |
Add -version flags to all three commands
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
-rw-r--r-- | man/xkbbell.man | 9 | ||||
-rw-r--r-- | man/xkbvleds.man | 10 | ||||
-rw-r--r-- | man/xkbwatch.man | 10 | ||||
-rw-r--r-- | xkbbell.c | 10 | ||||
-rw-r--r-- | xkbvleds.c | 5 | ||||
-rw-r--r-- | xkbwatch.c | 7 |
6 files changed, 49 insertions, 2 deletions
diff --git a/man/xkbbell.man b/man/xkbbell.man index f248202..9a9ba5f 100644 --- a/man/xkbbell.man +++ b/man/xkbbell.man @@ -32,6 +32,7 @@ xkbbell - XKB extension user utility [-kf <id>] [-v <volume>] [-w <id>] +[-help|-version] .SH DESCRIPTION user utility .SH OPTIONS @@ -71,5 +72,13 @@ specifies which volume to use .B \-w <id> specifies which window to use .PP +.TP 8 +.B \-help +print list of options and exit +.PP +.TP 8 +.B \-version +print program version and exit +.PP If neither device nor feedback are specified, xkbbell uses the default values for the core keyboard device. diff --git a/man/xkbvleds.man b/man/xkbvleds.man index e6827a5..65a8160 100644 --- a/man/xkbvleds.man +++ b/man/xkbvleds.man @@ -73,5 +73,11 @@ Watch only LEDs in all desired sets .TP 8 .B \-union Watch LEDs in any desired sets - - +.PP +.TP 8 +.B \-help +print list of options and exit +.PP +.TP 8 +.B \-version +print program version and exit diff --git a/man/xkbwatch.man b/man/xkbwatch.man index ec999a5..4655f02 100644 --- a/man/xkbwatch.man +++ b/man/xkbwatch.man @@ -24,3 +24,13 @@ xkbwatch - XKB extension user utility .SH DESCRIPTION This program reports changes in the fundamental components of the XKB keyboard state plus the effective compatibility state. +.SH OPTIONS +.I Xkbwatch +accepts all of the standard X Toolkit command line options along with the +additional options listed below: +.TP 8 +.B \-version +This option indicates that the program version should be printed, after +which the program exits. +.SH "SEE ALSO" +X(__miscmansuffix__) @@ -24,7 +24,12 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + #include <stdio.h> +#include <stdlib.h> #include <string.h> #include <X11/Xproto.h> #include <X11/Xlib.h> @@ -63,6 +68,10 @@ parseArgs(int argc, char *argv[]) (strcmp(argv[i], "-usage") == 0)) { return 0; } + else if (strcmp(argv[i], "-version") == 0) { + printf("xkbbell (%s) %s\n", PACKAGE_NAME, PACKAGE_VERSION); + exit(0); + } else if (strcmp(argv[i], "-synch") == 0) { synch = 1; } @@ -160,6 +169,7 @@ main(int argc, char *argv[]) fprintf(stderr, "Where legal options are:\n" "-help print this message\n" "-usage print this message\n" + "-version print the program version\n" "-display <dpy> specifies display to use\n" "-synch turn on synchronization\n" "-dev <id> specifies device to use\n" @@ -64,6 +64,7 @@ usage(char *program) uInformation("Usage: %s <options>\n", program); uInformation("Legal options include the usual X toolkit options plus:\n" " -help Print this message\n" + " -version Print the program version\n" " -indpy <name> Name of display to watch\n" " -watch <leds> Mask of LEDs to watch\n" " [-+]automatic (Don't) watch automatic LEDs\n" @@ -118,6 +119,10 @@ parseArgs(int argc, char *argv[]) usage(argv[0]); exit(0); } + else if (uStrCaseEqual(argv[i], "-version")) { + printf("xkbvleds (%s) %s\n", PACKAGE_NAME, PACKAGE_VERSION); + exit(0); + } else if ((argv[i][0] == '+') || (argv[i][0] == '-')) { Bool onoff; int *which; @@ -79,6 +79,13 @@ main(int argc, char *argv[]) NULL }; + for (i = 1; i < argc; i++) { + if (strcmp(argv[i], "-version") == 0) { + printf("xkbwatch (%s) %s\n", PACKAGE_NAME, PACKAGE_VERSION); + exit(0); + } + } + uSetErrorFile(NullString); toplevel = XtOpenApplication(&app_con, "XkbWatch", options, XtNumber(options), &argc, argv, |