::arg().laxParse(argc,argv);
if(::arg().mustDo("help")) {
- cerr<<"syntax:"<<endl<<endl;
- cerr<<::arg().helpstring(::arg()["help"])<<endl;
- exit(99);
+ cout<<"syntax:"<<endl<<endl;
+ cout<<::arg().helpstring(::arg()["help"])<<endl;
+ exit(0);
}
const vector<string>commands=::arg().getCommands();
::arg().set("delegation-only")=toLower(::arg()["delegation-only"]);
if(::arg().mustDo("help")) {
- cerr<<"syntax:"<<endl<<endl;
- cerr<<::arg().helpstring(::arg()["help"])<<endl;
- exit(99);
+ cout<<"syntax:"<<endl<<endl;
+ cout<<::arg().helpstring(::arg()["help"])<<endl;
+ exit(0);
}
if(::arg().mustDo("version")) {
showProductVersion();
//::arg().laxParse(argc,argv);
if(::arg().mustDo("help")) {
- cerr<<"syntax:"<<endl<<endl;
- cerr<<::arg().helpstring(::arg()["help"])<<endl;
- exit(99);
+ cout<<"syntax:"<<endl<<endl;
+ cout<<::arg().helpstring(::arg()["help"])<<endl;
+ exit(0);
}
if(::arg()["config-name"]!="")
arg().setCmd("help","Provide this helpful message");
arg().laxParse(argc,argv);
- if(arg().getCommands().empty() || arg().mustDo("help")) {
+ if(arg().mustDo("help")) {
+ 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);
}
if(::arg().mustDo("help")) {
- cerr<<"syntax:"<<endl<<endl;
- cerr<<::arg().helpstring(::arg()["help"])<<endl;
- exit(99);
+ cout<<"syntax:"<<endl<<endl;
+ cout<<::arg().helpstring(::arg()["help"])<<endl;
+ exit(0);
}
if(::arg().mustDo("config")) {
::arg().parse(argc, argv);
- if(argc<2 || ::arg().mustDo("help")) {
+ if(::arg().mustDo("help")) {
+ cout<<"syntax:"<<endl<<endl;
+ cout<<::arg().helpstring()<<endl;
+ exit(0);
+ }
+
+ if(argc<2) {
cerr<<"syntax:"<<endl<<endl;
cerr<<::arg().helpstring()<<endl;
exit(1);
args.parse( argc, argv );
- if( argc < 2 || args.mustDo( "help" ) )
+ if( args.mustDo( "help" ) )
+ {
+ cout << "Syntax:" << endl << endl;
+ cout << args.helpstring() << endl;
+ exit( 0 );
+ }
+
+ if( argc < 2 )
{
cerr << "Syntax:" << endl << endl;
cerr << args.helpstring() << endl;
::arg().parse(argc, argv);
- if(argc<2 || ::arg().mustDo("help")) {
+ if(::arg().mustDo("help")) {
+ cout<<"syntax:"<<endl<<endl;
+ cout<<::arg().helpstring()<<endl;
+ exit(0);
+ }
+
+ if(argc<2) {
cerr<<"syntax:"<<endl<<endl;
cerr<<::arg().helpstring()<<endl;
exit(1);