From 3f9c6b7417f3b72f1987327b860367b7d25f6303 Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Tue, 27 May 2008 21:36:49 +0200 Subject: [PATCH] Option -V shows yazproxy version. --- doc/yaz-proxy-ref.xml | 7 +++++++ src/yaz-proxy-main.cpp | 11 ++++++++++- 2 files changed, 17 insertions(+), 1 deletion(-) 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; -- 1.7.10.4