]> granicus.if.org Git - pdns/commitdiff
Add --version to dnsdist
authorPieter Lexis <pieter.lexis@powerdns.com>
Wed, 25 Nov 2015 16:42:41 +0000 (17:42 +0100)
committerPieter Lexis <pieter.lexis@powerdns.com>
Thu, 26 Nov 2015 08:55:54 +0000 (09:55 +0100)
pdns/dnsdist.cc

index fc72f8316d2c5fc611298a39136cbf05b84f6ae9..3253e4423d6eeb68d343632460c0c86b670d75e2 100644 (file)
@@ -1103,13 +1103,14 @@ try
     {"pidfile",  required_argument, 0, 'p'},
     {"supervised", 0, 0, 's'},
     {"uid",  required_argument, 0, 'u'},
+    {"version", 0, 0, 'V'},
     {"help", 0, 0, 'h'},
     {0,0,0,0} 
   };
   int longindex=0;
   string optstring;
   for(;;) {
-    int c=getopt_long(argc, argv, "a:hcde:C:l:vp:g:u:", longopts, &longindex);
+    int c=getopt_long(argc, argv, "a:hcde:C:l:vp:g:u:V", longopts, &longindex);
     if(c==-1)
       break;
     switch(c) {
@@ -1129,6 +1130,8 @@ try
       g_cmdLine.gid=optarg;
       break;
     case 'h':
+      cout<<"dnsdist "<<VERSION<<endl;
+      cout<<endl;
       cout<<"Syntax: dnsdist [-C,--config file] [-c,--client] [-d,--daemon]\n";
       cout<<"[-p,--pidfile file] [-e,--execute cmd] [-h,--help] [-l,--local addr]\n";
       cout<<"\n";
@@ -1166,6 +1169,10 @@ try
     case 'v':
       g_verbose=true;
       break;
+    case 'V':
+      cout<<"dnsdist "<<VERSION<<endl;
+      exit(EXIT_SUCCESS);
+      break;
     }
   }
   argc-=optind;