diff options
author | Alan Coopersmith <alan.coopersmith@oracle.com> | 2014-05-23 23:55:31 -0700 |
---|---|---|
committer | Alan Coopersmith <alan.coopersmith@oracle.com> | 2014-05-23 23:55:31 -0700 |
commit | b54815bb48784246cbf5f62c4078c45d34ec19d0 (patch) | |
tree | 8692f2e9264a9edae8b1be31a71b7548aaf669fb | |
parent | 0193fcd1732c2ee37896ae779b97a8b2ee79a3c1 (diff) |
Add -version option to print program version
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
-rw-r--r-- | xfindproxy.c | 10 | ||||
-rw-r--r-- | xfindproxy.man | 6 |
2 files changed, 14 insertions, 2 deletions
diff --git a/xfindproxy.c b/xfindproxy.c index 5ca21db..0cade8b 100644 --- a/xfindproxy.c +++ b/xfindproxy.c @@ -27,6 +27,9 @@ from The Open Group. */ /* $XFree86: xc/programs/xfindproxy/xfindproxy.c,v 1.8tsi Exp $ */ +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif #include <stdio.h> #include <X11/Xos.h> @@ -123,7 +126,8 @@ usage (void) "usage: xfindproxy -server serverAddr -name serviceName" " [-manager managerAddr]\n" " [-auth] [-host hostAddr] [-options opts]\n" - "-manager can be omitted only if PROXY_MANAGER is in the environment\n"); + "-manager can be omitted only if PROXY_MANAGER is in the environment\n" + " xfindproxy -version\n"); exit (1); } @@ -188,6 +192,10 @@ main(int argc, char *argv[]) if (++i >= argc) goto usage; startOptions = XtNewString (argv[i]); continue; + + case 'v': + puts(PACKAGE_STRING); + exit(0); } } diff --git a/xfindproxy.man b/xfindproxy.man index 122c6f8..6bfe63c 100644 --- a/xfindproxy.man +++ b/xfindproxy.man @@ -30,7 +30,7 @@ .SH NAME xfindproxy - locate proxy services .SH SYNOPSIS -\fBxfindproxy\fP \fB\-manager\fP \fImanagerAddr\fP \fB\-name\fP \fIserviceName\fP \fB\-server\fP \fIserverAddr\fP [\fB\-auth\fP] [\fB\-host\fP \fIhostAddr\fP] [\fB\-options\fP \fIopts\fP] +\fBxfindproxy\fP \fB\-manager\fP \fImanagerAddr\fP \fB\-name\fP \fIserviceName\fP \fB\-server\fP \fIserverAddr\fP [\fB\-auth\fP] [\fB\-host\fP \fIhostAddr\fP] [\fB\-options\fP \fIopts\fP] [\fB-version\fP] .SH DESCRIPTION .B xfindproxy is a program used to locate available proxy services. It utilizes @@ -81,6 +81,10 @@ to each proxy server and are not defined here. In the event that xfindproxy locates an already existing proxy, the options will be passed, but the semantics of how the proxy uses these options are undefined. .PP +The +.B \-version +argument prints the program version and exits. +.PP If xfindproxy is successful in obtaining a proxy address, it will print it to stdout. The format of the proxy address is specific to the proxy service being used. For example, for a proxy service of "LBX", the proxy address would be |