From 86fda0478065488dfc423b67ea1747817106335f Mon Sep 17 00:00:00 2001 From: Alan Coopersmith Date: Fri, 19 Jul 2013 22:47:38 -0700 Subject: Add -version flag Signed-off-by: Alan Coopersmith --- man/xset.man | 7 +++++++ xset.c | 7 ++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/man/xset.man b/man/xset.man index ff46e9f..e9f1c5e 100644 --- a/man/xset.man +++ b/man/xset.man @@ -64,6 +64,8 @@ xset - user preference utility for X [s {expose|noexpose}] [s {on|off}] [s default] [s activate] [s reset] .br [q] +.br +[-version] .SH DESCRIPTION This program is used to set various user preference options of the display. .SH OPTIONS @@ -282,6 +284,11 @@ If only one numerical parameter is given, it will be used for the length. .B q The \fBq\fP option gives you information on the current settings. .PP +.TP 8 +.B -version +The \fB-version\fP option prints the program version and exits without +doing anything else. +.PP These settings will be reset to default values when you log out. .PP Note that not all X implementations are guaranteed to honor all of these diff --git a/xset.c b/xset.c index 65f2c94..2301fa1 100644 --- a/xset.c +++ b/xset.c @@ -185,6 +185,9 @@ main(int argc, char *argv[]) if (++i >= argc) usage("missing argument to -display"); disp = argv[i]; + } else if (strcmp(arg, "-version") == 0) { + puts(PACKAGE_STRING); + exit(EXIT_SUCCESS); } else { hasargs = True; } @@ -1648,7 +1651,9 @@ usage(const char *fmt, ...) "\t s blank s noblank s off\n" "\t s expose s noexpose\n" "\t s activate s reset\n" - " For status information: q\n"); + " For status information: q\n" + " To print version: -version\n" + ); exit(EXIT_SUCCESS); } -- cgit v1.2.3