summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@oracle.com>2013-01-19 11:33:48 -0800
committerAlan Coopersmith <alan.coopersmith@oracle.com>2013-01-19 11:33:48 -0800
commit849880e1cca492665a7c8581e5591065299ab718 (patch)
tree7c81b1efa173612afbd53d46db05d6d15a48184e
parent590aa5f17cd4b8d710662e6af701c166392d0235 (diff)
Add -V option to print command version
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
-rw-r--r--appres.c11
-rw-r--r--man/appres.man4
2 files changed, 13 insertions, 2 deletions
diff --git a/appres.c b/appres.c
index 506d31f..2f43d2d 100644
--- a/appres.c
+++ b/appres.c
@@ -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)
diff --git a/man/appres.man b/man/appres.man
index d36afdd..10ec801 100644
--- a/man/appres.man
+++ b/man/appres.man
@@ -27,7 +27,7 @@
appres \- list X application resource database
.SH SYNOPSIS
.B "appres"
-[class [instance]] [\-1] [toolkitoptions]
+[class [instance]] [-1] [-V] [toolkitoptions]
.SH DESCRIPTION
.PP
The \fIappres\fP program prints the resources seen by an application
@@ -82,6 +82,8 @@ use the \-1 option. For example,
.in -.5i
.sp 1
will list the resources matching the \fIxterm\fP vt100 widget.
+.PP
+The -V option prints the appres command version and exits.
.SH "SEE ALSO"
.PP
X(__miscmansuffix__), xrdb(__appmansuffix__), listres(__appmansuffix__)