summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@oracle.com>2013-07-19 19:51:09 -0700
committerAlan Coopersmith <alan.coopersmith@oracle.com>2013-07-22 20:41:19 -0700
commit4e49a64191d3b08044d29d32896e15013e5e7540 (patch)
treef67582b3b88dbcbf54feddb5f63950d3289b2ac1
parentec7b273fd135a14a2ca6c19cd0e6afe1536db552 (diff)
Add -version flag to print package version string from autoconf
Also adds missing entry for -help flag to usage message. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-By: Matt Dew <marcoz@osource.org>
-rw-r--r--man/xrdb.man4
-rw-r--r--xrdb.c5
2 files changed, 9 insertions, 0 deletions
diff --git a/man/xrdb.man b/man/xrdb.man
index 7f0ccf1..211c0a2 100644
--- a/man/xrdb.man
+++ b/man/xrdb.man
@@ -168,6 +168,10 @@ program accepts the following options:
This option (or any unsupported option) will cause a brief description of
the allowable options and parameters to be printed.
.TP 8
+.B \-version
+This option will cause the xrdb version to be printed and the program to exit
+without performing any other operations.
+.TP 8
.B \-display \fIdisplay\fP
This option specifies the X server to be used; see \fIX(__miscmansuffix__)\fP.
It also specifies the screen to use for the \fI-screen\fP option,
diff --git a/xrdb.c b/xrdb.c
index 58dd049..24a6aa5 100644
--- a/xrdb.c
+++ b/xrdb.c
@@ -738,6 +738,8 @@ Syntax (void)
fprintf (stderr,
"usage: %s [-options ...] [filename]\n\n"
"where options include:\n"
+ " -help print this help message\n"
+ " -version print the program version\n"
" -display host:dpy display to use\n"
" -all do all resources [default]\n"
" -global do screen-independent resources\n"
@@ -898,6 +900,9 @@ main(int argc, char *argv[])
} else if (isabbreviation ("-help", arg, 2)) {
Syntax ();
/* doesn't return */
+ } else if (isabbreviation ("-version", arg, 2)) {
+ printf("%s\n", PACKAGE_STRING);
+ exit(0);
} else if (isabbreviation ("-display", arg, 2)) {
if (++i >= argc) Syntax ();
displayname = argv[i];