From: Adam Dickmeiss Date: Tue, 27 May 2008 19:36:49 +0000 (+0200) Subject: Option -V shows yazproxy version. X-Git-Tag: v1.3.4~5 X-Git-Url: http://lists.indexdata.dk/?a=commitdiff_plain;h=3f9c6b7417f3b72f1987327b860367b7d25f6303;p=yazproxy-moved-to-github.git Option -V shows yazproxy version. --- diff --git a/doc/yaz-proxy-ref.xml b/doc/yaz-proxy-ref.xml index 77c66bd..20d6fb3 100644 --- a/doc/yaz-proxy-ref.xml +++ b/doc/yaz-proxy-ref.xml @@ -22,6 +22,7 @@ -T seconds -u userid -v level + -V -X host:port @@ -147,6 +148,12 @@ {fatal,debug,warn,log,malloc,all,none}. + -V + + Displays yazproxy version and exits with status code 0. Should + not be used in conjunction with other options. + + -X Enables debugging mode for the proxy. When specified, the proxy will diff --git a/src/yaz-proxy-main.cpp b/src/yaz-proxy-main.cpp index d53d10d..5c9ff2d 100644 --- a/src/yaz-proxy-main.cpp +++ b/src/yaz-proxy-main.cpp @@ -76,7 +76,7 @@ int args(Yaz_Proxy *proxy, int argc, char **argv) char *prog = argv[0]; int ret; - while ((ret = options("o:a:Dt:v:c:u:i:m:l:T:p:n:X", + while ((ret = options("o:a:Dt:v:c:u:i:m:l:T:p:n:VX", argv, argc, &arg)) != -2) { int err; @@ -142,6 +142,15 @@ int args(Yaz_Proxy *proxy, int argc, char **argv) case 'v': yaz_log_init_level (yaz_log_mask_str(arg)); break; + case 'V': + puts( +#ifdef VERSION + VERSION +#else + "unknown" +#endif + ); + exit(0); case 'X': proxy->set_debug_mode(1); daemon_flags = YAZ_DAEMON_DEBUG;