diff options
author | Alan Coopersmith <alan.coopersmith@oracle.com> | 2013-01-19 11:33:48 -0800 |
---|---|---|
committer | Alan Coopersmith <alan.coopersmith@oracle.com> | 2013-01-19 11:33:48 -0800 |
commit | 849880e1cca492665a7c8581e5591065299ab718 (patch) | |
tree | 7c81b1efa173612afbd53d46db05d6d15a48184e /appres.c | |
parent | 590aa5f17cd4b8d710662e6af701c166392d0235 (diff) |
Add -V option to print command version
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Diffstat (limited to 'appres.c')
-rw-r--r-- | appres.c | 11 |
1 files changed, 10 insertions, 1 deletions
@@ -25,6 +25,10 @@ in this Software without prior written authorization from The Open Group. * Author: Jim Fulton, MIT X Consortium */ +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + #include <X11/Intrinsic.h> #include <stdio.h> #include <stdlib.h> @@ -39,8 +43,9 @@ static void _X_NORETURN usage (void) { fprintf (stderr, - "usage: %s [class [instance]] [-1] [toolkitoptions]\n" + "usage: %s [class [instance]] [-1] [-V] [toolkitoptions]\n" "-1 list resources only at the specified level\n" + "-V print command version and exit\n" "The number of class and instance elements must be equal.\n", ProgramName); exit (1); @@ -147,6 +152,10 @@ main (int argc, char *argv[]) for (i = 1; i < argc; i++) { if (!strcmp(argv[i], "-1")) mode = XrmEnumOneLevel; + else if (!strcmp(argv[i], "-V")) { + printf("%s\n", PACKAGE_STRING); + exit(0); + } else if (argv[i][0] == '-') usage(); else if (!cname) |