summaryrefslogtreecommitdiff
path: root/xauth.c
diff options
context:
space:
mode:
authorDr. Tilmann Bubeck <t.bubeck@reinform.de>2013-10-08 21:34:49 +0200
committerDr. Tilmann Bubeck <t.bubeck@reinform.de>2013-10-08 21:34:49 +0200
commit4e05bce6da8eeb9eb98624cf868675eaf5816df5 (patch)
tree40f547d1d22bf87435f5d1b093c3af7940c48a28 /xauth.c
parente53df261c9ca11435df0c8853350d913b557446b (diff)
downloadxorg-app-xauth-4e05bce6da8eeb9eb98624cf868675eaf5816df5.tar.gz
Added command "version" and command line arg "-V" to show version of xauth.
Diffstat (limited to 'xauth.c')
-rw-r--r--xauth.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/xauth.c b/xauth.c
index d34e4df..85fcaf4 100644
--- a/xauth.c
+++ b/xauth.c
@@ -68,6 +68,7 @@ usage(void)
" -q turn off extra messages",
" -i ignore locks on authority file",
" -b break locks on authority file",
+" -V show version number of xauth",
"",
"and commands have the following syntax:",
"",
@@ -112,9 +113,8 @@ main(int argc, const char *argv[])
if (arg[0] == '-') {
const char *flag;
-
for (flag = (arg + 1); *flag; flag++) {
- switch (*flag) {
+ switch (*flag) {
case 'f': /* -f authfilename */
if (++i >= argc) usage ();
authfilename = argv[i];
@@ -134,9 +134,12 @@ main(int argc, const char *argv[])
case 'n': /* -n */
no_name_lookups = True;
continue;
+ case 'V': /* -V */
+ puts(PACKAGE_VERSION);
+ exit(0);
default:
usage ();
- }
+ }
}
} else {
sourcename = "(argv)";