tool/main.cpp
changeset 1121 52a005ffd011
parent 1120 0ae26760c12d
child 1122 ee305a780a02
equal deleted inserted replaced
1120:0ae26760c12d 1121:52a005ffd011
    25 static string command;
    25 static string command;
    26 vector<string> commandArgs;
    26 vector<string> commandArgs;
    27 static Master::Verbosity verbosity = Master::Normal;
    27 static Master::Verbosity verbosity = Master::Normal;
    28 string dataTypeStr;
    28 string dataTypeStr;
    29 bool force = false;
    29 bool force = false;
    30 bool helpWanted = false;
    30 bool helpRequested = false;
    31 
    31 
    32 /*****************************************************************************/
    32 /*****************************************************************************/
    33 
    33 
    34 void printUsage()
    34 void printUsage()
    35 {
    35 {
   152             case 'v':
   152             case 'v':
   153                 verbosity = Master::Verbose;
   153                 verbosity = Master::Verbose;
   154                 break;
   154                 break;
   155 
   155 
   156             case 'h':
   156             case 'h':
   157                 helpWanted = true;
   157                 helpRequested = true;
   158                 break;
   158                 break;
   159 
   159 
   160             case '?':
   160             case '?':
   161                 printUsage();
   161                 printUsage();
   162                 exit(1);
   162                 exit(1);
   168     while (c != -1);
   168     while (c != -1);
   169 
   169 
   170 	argCount = argc - optind;
   170 	argCount = argc - optind;
   171 
   171 
   172     if (!argCount) {
   172     if (!argCount) {
   173         if (!helpWanted) {
   173         if (!helpRequested) {
   174             cerr << "Please specify a command!" << endl;
   174             cerr << "Please specify a command!" << endl;
   175         }
   175         }
   176         printUsage();
   176         printUsage();
   177         exit(!helpWanted);
   177         exit(!helpRequested);
   178 	}
   178 	}
   179 
   179 
   180     command = argv[optind];
   180     command = argv[optind];
   181     while (++optind < argc)
   181     while (++optind < argc)
   182         commandArgs.push_back(string(argv[optind]));
   182         commandArgs.push_back(string(argv[optind]));