]> jspc29.x-matter.uni-frankfurt.de Git - trbnettools.git/commitdiff
added -V option
authorhadaq <hadaq>
Mon, 17 Oct 2011 20:58:05 +0000 (20:58 +0000)
committerhadaq <hadaq>
Mon, 17 Oct 2011 20:58:05 +0000 (20:58 +0000)
trbnetd/server/trbnetd.c

index eada7cb061b4c9d0d079d1b9b6798ef42dee4247..13f3eddddcc5d3a7a155b38136ddd586be9c79e8 100644 (file)
@@ -14,6 +14,8 @@
 
 #include "trbrpc.h"
 
+static const char trbnetd_version[] = "$Revision: 1.11 $";
+
 int trbnetrpcprog_1_freeresult(SVCXPRT * transp,
                                xdrproc_t xdr_result, caddr_t result)
 {
@@ -358,6 +360,7 @@ void usage(const char *progName)
   fprintf(stdout, "Options:\n");
   fprintf(stdout, "  -h    give this help\n");
   fprintf(stdout, "  -f    execute as foreground process\n");
+  fprintf(stdout, "  -V    version number\n");
 }
 
 static pid_t myPid = -1;
@@ -370,7 +373,7 @@ int main(int argc, char **argv)
   int opt;
   
   optind = 1;
-  while ((opt = getopt(argc, argv, "+hfd:")) != -1) {
+  while ((opt = getopt(argc, argv, "+hfVd:")) != -1) {
     switch (opt) {
     case '?':
       usage(basename(argv[0]));
@@ -384,6 +387,11 @@ int main(int argc, char **argv)
     case 'd':
       trb_debug = strtoul(optarg, NULL, 0);
       break;
+    case 'V':      
+      printf("%s %s, using libtrbnet %s\n",
+             basename(argv[0]), trbnetd_version, trbnet_version);
+      exit(EXIT_SUCCESS);
+      break;
 
     default:
       break;