Option -V shows yazproxy version.
authorAdam Dickmeiss <adam@indexdata.dk>
Tue, 27 May 2008 19:36:49 +0000 (21:36 +0200)
committerAdam Dickmeiss <adam@indexdata.dk>
Tue, 27 May 2008 19:36:49 +0000 (21:36 +0200)
doc/yaz-proxy-ref.xml
src/yaz-proxy-main.cpp

index 77c66bd..20d6fb3 100644 (file)
@@ -22,6 +22,7 @@
   <arg choice="opt">-T <replaceable>seconds</replaceable></arg>
   <arg choice="opt">-u <replaceable>userid</replaceable></arg>
   <arg choice="opt">-v <replaceable>level</replaceable></arg>
+  <arg choice="opt">-V</arg>
   <arg choice="opt">-X</arg>
   <arg choice="req"><replaceable>host</replaceable>:<replaceable>port</replaceable></arg>
  </cmdsynopsis>
      {<literal>fatal</literal>,<literal>debug</literal>,<literal>warn</literal>,<literal>log</literal>,<literal>malloc</literal>,<literal>all</literal>,<literal>none</literal>}.
     </para></listitem>
   </varlistentry>
+  <varlistentry><term>-V</term>
+   <listitem><para>
+     Displays yazproxy version and exits with status code 0. Should
+     not be used in conjunction with other options.
+    </para></listitem>
+  </varlistentry>
   <varlistentry><term>-X</term>
    <listitem><para>
      Enables debugging mode for the proxy. When specified, the proxy will
index d53d10d..5c9ff2d 100644 (file)
@@ -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;