diff options
author | Alan Coopersmith <alan.coopersmith@oracle.com> | 2014-06-03 23:58:54 -0700 |
---|---|---|
committer | Alan Coopersmith <alan.coopersmith@oracle.com> | 2014-06-03 23:58:54 -0700 |
commit | 017b3736489985999d8dcf4d9e473e1fd6dd3647 (patch) | |
tree | 3c016e7996e3a00fbfe2df9031bbeaac71005347 | |
parent | d41d834d8b2be86eb56802de12c2399c7ff0919f (diff) |
Add -version option to print program version
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
-rw-r--r-- | man/xwininfo.man | 8 | ||||
-rw-r--r-- | xwininfo.c | 5 |
2 files changed, 12 insertions, 1 deletions
diff --git a/man/xwininfo.man b/man/xwininfo.man index 6da7139..66418c6 100644 --- a/man/xwininfo.man +++ b/man/xwininfo.man @@ -32,7 +32,7 @@ xwininfo \- window information utility for X [\-children] [\-tree] [\-stats] [\-bits] [\-events] [\-size] [\-wm] [\-shape] [\-frame] [\-all] [\-english] [\-metric] -[\-display \fIdisplay\fP] +[\-display \fIdisplay\fP] [\-version] .SH DESCRIPTION .PP .I Xwininfo @@ -154,6 +154,12 @@ This option is a quick way to ask for all information possible. .TP 8 .B \-display \fIdisplay\fP This option allows you to specify the server to connect to; see \fIX(__miscmansuffix__)\fP. +PP +.TP 8 +.B \-version +This option indicates that +.I xwininfo +should print its version information and exit. .SH EXAMPLE .PP The following is a sample summary taken with no options specified: @@ -286,6 +286,7 @@ usage (void) "usage: %s [-options ...]\n\n" "where options include:\n" " -help print this message\n" + " -version print version message\n" " -display host:dpy X server to contact\n" " -root use the root window\n" " -id windowid use the window with the specified id\n" @@ -537,6 +538,10 @@ main (int argc, char **argv) tree = stats = bits = events = wm = size = shape = 1; continue; } + if (!strcmp(argv[i], "-version")) { + puts(PACKAGE_STRING); + exit(0); + } fprintf (stderr, "%s: unrecognized argument %s\n\n", program_name, argv[i]); usage (); |