]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Add --version to pdnsutil
authorPieter Lexis <pieter.lexis@powerdns.com>
Fri, 29 Apr 2016 12:48:27 +0000 (14:48 +0200)
committerPieter Lexis <pieter.lexis@powerdns.com>
Fri, 29 Apr 2016 12:48:27 +0000 (14:48 +0200)
pdns/pdnsutil.cc

index 3ca36583440c0ffdf759a9c15249f3a8aa696015..fbe6e955b1934b2a20bc323156b0ef6ee801cd0c 100644 (file)
@@ -1861,6 +1861,7 @@ try
   po::options_description desc("Allowed options");
   desc.add_options()
     ("help,h", "produce help message")
+    ("version", "show version")
     ("verbose,v", "be verbose")
     ("force", "force an action")
     ("config-name", po::value<string>()->default_value(""), "virtual configuration name")
@@ -1874,11 +1875,16 @@ try
 
   vector<string> cmds;
 
-  if(g_vm.count("commands")) 
+  if(g_vm.count("commands"))
     cmds = g_vm["commands"].as<vector<string> >();
 
   g_verbose = g_vm.count("verbose");
 
+  if (g_vm.count("version")) {
+    cout<<"pdnsutil "<<VERSION<<endl;
+    return 0;
+  }
+
   if(cmds.empty() || g_vm.count("help") || cmds[0] == "help") {
     cout<<"Usage: \npdnsutil [options] <command> [params ..]\n"<<endl;
     cout<<"Commands:"<<endl;