]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
make pdns_control and rec_control mention the 'help' command to query pdns for possib...
authorbert hubert <bert.hubert@powerdns.com>
Thu, 17 Sep 2015 14:52:10 +0000 (16:52 +0200)
committerbert hubert <bert.hubert@powerdns.com>
Thu, 17 Sep 2015 14:52:10 +0000 (16:52 +0200)
pdns/dynloader.cc
pdns/rec_control.cc

index cd5771b2eedc518bf22a140dc12b7314835e7933..a079c2fa30d9c35b96765f6a6ec7c4e69336bf4c 100644 (file)
@@ -73,6 +73,7 @@ int main(int argc, char **argv)
   if(::arg().mustDo("help")) {
     cout<<"syntax:"<<endl<<endl;
     cout<<::arg().helpstring(::arg()["help"])<<endl;
+    cout<<"In addition, 'pdns_control help' can be used to retrieve a list\nof available commands from PowerDNS"<<endl;
     exit(0);
   }
 
index eb45651e1e3d2e162aea9d7e22becda9244190a4..df370e0fd28867f6b75da5b0e8d43e9d161edf4c 100644 (file)
@@ -51,16 +51,11 @@ static void initArguments(int argc, char** argv)
   arg().setCmd("help","Provide this helpful message");
 
   arg().laxParse(argc,argv);  
-  if(arg().mustDo("help")) {
+  if(arg().mustDo("help") || arg().getCommands().empty()) {
     cout<<"syntax: rec_control [options] command, options as below: "<<endl<<endl;
     cout<<arg().helpstring(arg()["help"])<<endl;
-    exit(0);
-  }
-
-  if(arg().getCommands().empty()) {
-    cerr<<"syntax: rec_control [options] command, options as below: "<<endl<<endl;
-    cerr<<arg().helpstring(arg()["help"])<<endl;
-    exit(99);
+    cout<<"In addition, 'rec_control help' can be used to retrieve a list\nof available commands from PowerDNS"<<endl;
+    exit(arg().mustDo("help") ? 0 : 99);
   }
 
   string configname=::arg()["config-dir"]+"/recursor.conf";