summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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__)