summaryrefslogtreecommitdiff
path: root/xdpyinfo.c
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@oracle.com>2013-01-21 23:13:03 -0800
committerAlan Coopersmith <alan.coopersmith@oracle.com>2013-01-21 23:13:03 -0800
commit1b9a3d5459f61abf6285df81e4a75cb472e2a40c (patch)
tree27b88c0dfbccd6a84900e13d35bef28f7aae6898 /xdpyinfo.c
parent27c57ec56abbd175c7a3ea7c50d85e91e1940c87 (diff)
Add -version option to print version number
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Diffstat (limited to 'xdpyinfo.c')
-rw-r--r--xdpyinfo.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/xdpyinfo.c b/xdpyinfo.c
index 26bb0fb..655d672 100644
--- a/xdpyinfo.c
+++ b/xdpyinfo.c
@@ -1441,6 +1441,7 @@ usage(void)
{
fprintf (stderr, "usage: %s [options]\n%s", ProgramName,
"-display displayname\tserver to query\n"
+ "-version\t\tprint program version and exit\n"
"-queryExtensions\tprint info returned by XQueryExtension\n"
"-ext all\t\tprint detailed info for all supported extensions\n"
"-ext extension-name\tprint detailed info for extension-name if one of:\n ");
@@ -1470,6 +1471,9 @@ main(int argc, char *argv[])
} else if (!strncmp("-ext", arg, len)) {
if (++i >= argc) usage ();
mark_extension_for_printing(argv[i]);
+ } else if (!strncmp("-version", arg, len)) {
+ printf("%s\n", PACKAGE_STRING);
+ exit (0);
} else
usage ();
}