]> granicus.if.org Git - pdns/commitdiff
Add --version to rec_control
authorPieter Lexis <pieter.lexis@powerdns.com>
Fri, 1 May 2015 12:25:45 +0000 (14:25 +0200)
committerPieter Lexis <pieter.lexis@powerdns.com>
Fri, 29 Apr 2016 12:32:45 +0000 (14:32 +0200)
pdns/rec_control.cc

index 207c364ae96a26a81ca1a5b9935103789ef2a599..b87a34cd2cc2389e495cb994bbb7f43c252f4b68 100644 (file)
@@ -50,6 +50,7 @@ static void initArguments(int argc, char** argv)
   arg().set("timeout", "Number of seconds to wait for the recursor to respond")="5";
   arg().set("config-name","Name of this virtual configuration - will rename the binary image")="";
   arg().setCmd("help","Provide this helpful message");
+  arg().setCmd("version","Show the version of this program");
 
   arg().laxParse(argc,argv);  
   if(arg().mustDo("help") || arg().getCommands().empty()) {
@@ -59,6 +60,11 @@ static void initArguments(int argc, char** argv)
     exit(arg().mustDo("help") ? 0 : 99);
   }
 
+  if(arg().mustDo("version")) {
+    cout<<"rec_control version "<<VERSION<<endl;
+    exit(0);
+  }
+
   string configname=::arg()["config-dir"]+"/recursor.conf";
   if (::arg()["config-name"] != "")
     configname=::arg()["config-dir"]+"/recursor-"+::arg()["config-name"]+".conf";