summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@oracle.com>2014-06-03 18:29:44 -0700
committerAlan Coopersmith <alan.coopersmith@oracle.com>2014-06-03 18:29:44 -0700
commitb0ae4b903067017ec7dc19f27d3916d2153410af (patch)
treec1b7f83de32d18a2abffd7af9c56c6e42a27b0a4
parentfaa4fa7785addc2170d4de7bf13d377324597e99 (diff)
Add -version option to print program version
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
-rw-r--r--man/xprop.man5
-rw-r--r--xprop.c7
2 files changed, 11 insertions, 1 deletions
diff --git a/man/xprop.man b/man/xprop.man
index 81dc021..245cf9a 100644
--- a/man/xprop.man
+++ b/man/xprop.man
@@ -36,6 +36,7 @@ xprop - property displayer for X
[-remove \fIproperty-name\fP]
[-set \fIproperty-name\fP \fIvalue\fP]
[-spy]
+[-version]
[-f \fIatom\fP \fIformat\fP [\fIdformat\fP]]*
[\fIformat\fP [\fIdformat\fP] \fIatom\fP]*
.SH SUMMARY
@@ -121,6 +122,10 @@ indicated window.
Examine window properties forever, looking for property change events.
.PP
.TP 8
+.B "-verson"
+Print program version information and exit.
+.PP
+.TP 8
.B "-f \fIname\fP \fIformat\fP [\fIdformat\fP]"
Specifies that the \fIformat\fP for \fIname\fP should be \fIformat\fP and that
the \fIdformat\fP for \fIname\fP should be \fIdformat\fP. If \fIdformat\fP
diff --git a/xprop.c b/xprop.c
index 3885ddc..a4ee2c9 100644
--- a/xprop.c
+++ b/xprop.c
@@ -1785,7 +1785,8 @@ usage (const char *errmsg)
" -fs filename where to look for formats for properties\n"
" -frame don't ignore window manager frames\n"
" -f propname format [dformat] formats to use for property of given name\n"
-" -spy examine window properties forever\n";
+" -spy examine window properties forever\n"
+" -version print program version\n";
fflush (stdout);
@@ -1970,6 +1971,10 @@ main (int argc, char **argv)
Parse_Format_Mapping(&argc, &argv);
continue;
}
+ if (!strcmp(argv[0], "-version")) {
+ puts(PACKAGE_STRING);
+ exit(0);
+ }
fprintf (stderr, "%s: unrecognized argument %s\n\n",
program_name, argv[0]);
usage(NULL);