tool/main.cpp
branchstable-1.5
changeset 2529 c7e1f2616a9d
parent 2436 960cc1bb6b4a
child 2666 d9e14a0ddbd6
equal deleted inserted replaced
2528:8bb574da5da2 2529:c7e1f2616a9d
    81 string aliases = "-"; // all aliases
    81 string aliases = "-"; // all aliases
    82 string domains = "-"; // all domains
    82 string domains = "-"; // all domains
    83 string dataTypeStr;
    83 string dataTypeStr;
    84 Command::Verbosity verbosity = Command::Normal;
    84 Command::Verbosity verbosity = Command::Normal;
    85 bool force = false;
    85 bool force = false;
       
    86 bool emergency = false;
    86 bool helpRequested = false;
    87 bool helpRequested = false;
    87 string outputFile;
    88 string outputFile;
    88 string skin;
    89 string skin;
    89 
    90 
    90 /*****************************************************************************/
    91 /*****************************************************************************/
   147         {"position",    required_argument, NULL, 'p'},
   148         {"position",    required_argument, NULL, 'p'},
   148         {"domain",      required_argument, NULL, 'd'},
   149         {"domain",      required_argument, NULL, 'd'},
   149         {"type",        required_argument, NULL, 't'},
   150         {"type",        required_argument, NULL, 't'},
   150         {"output-file", required_argument, NULL, 'o'},
   151         {"output-file", required_argument, NULL, 'o'},
   151         {"skin",        required_argument, NULL, 's'},
   152         {"skin",        required_argument, NULL, 's'},
       
   153         {"emergency",   no_argument,       NULL, 'e'},
   152         {"force",       no_argument,       NULL, 'f'},
   154         {"force",       no_argument,       NULL, 'f'},
   153         {"quiet",       no_argument,       NULL, 'q'},
   155         {"quiet",       no_argument,       NULL, 'q'},
   154         {"verbose",     no_argument,       NULL, 'v'},
   156         {"verbose",     no_argument,       NULL, 'v'},
   155         {"help",        no_argument,       NULL, 'h'},
   157         {"help",        no_argument,       NULL, 'h'},
   156         {}
   158         {}
   157     };
   159     };
   158 
   160 
   159     do {
   161     do {
   160         c = getopt_long(argc, argv, "m:a:p:d:t:o:s:fqvh", longOptions, NULL);
   162         c = getopt_long(argc, argv, "m:a:p:d:t:o:s:efqvh", longOptions, NULL);
   161 
   163 
   162         switch (c) {
   164         switch (c) {
   163             case 'm':
   165             case 'm':
   164                 masters = optarg;
   166                 masters = optarg;
   165                 break;
   167                 break;
   184                 outputFile = optarg;
   186                 outputFile = optarg;
   185                 break;
   187                 break;
   186 
   188 
   187             case 's':
   189             case 's':
   188                 skin = optarg;
   190                 skin = optarg;
       
   191                 break;
       
   192 
       
   193             case 'e':
       
   194                 emergency = true;
   189                 break;
   195                 break;
   190 
   196 
   191             case 'f':
   197             case 'f':
   192                 force = true;
   198                 force = true;
   193                 break;
   199                 break;
   313                     cmd->setPositions(positions);
   319                     cmd->setPositions(positions);
   314                     cmd->setDomains(domains);
   320                     cmd->setDomains(domains);
   315                     cmd->setDataType(dataTypeStr);
   321                     cmd->setDataType(dataTypeStr);
   316                     cmd->setOutputFile(outputFile);
   322                     cmd->setOutputFile(outputFile);
   317                     cmd->setSkin(skin);
   323                     cmd->setSkin(skin);
       
   324                     cmd->setEmergency(emergency);
   318                     cmd->setForce(force);
   325                     cmd->setForce(force);
   319                     cmd->execute(commandArgs);
   326                     cmd->execute(commandArgs);
   320                 } catch (InvalidUsageException &e) {
   327                 } catch (InvalidUsageException &e) {
   321                     cerr << e.what() << endl << endl;
   328                     cerr << e.what() << endl << endl;
   322                     cerr << cmd->helpString(binaryBaseName);
   329                     cerr << cmd->helpString(binaryBaseName);