tool/main.cpp
changeset 2589 2b9c78543663
parent 2011 04fdb4abf120
child 2597 0e145bb05859
equal deleted inserted replaced
2415:af21f0bdc7c9 2589:2b9c78543663
    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;
       
    89 string skin;
    88 
    90 
    89 /*****************************************************************************/
    91 /*****************************************************************************/
    90 
    92 
    91 string usage()
    93 string usage()
    92 {
    94 {
   145         {"alias",       required_argument, NULL, 'a'},
   147         {"alias",       required_argument, NULL, 'a'},
   146         {"position",    required_argument, NULL, 'p'},
   148         {"position",    required_argument, NULL, 'p'},
   147         {"domain",      required_argument, NULL, 'd'},
   149         {"domain",      required_argument, NULL, 'd'},
   148         {"type",        required_argument, NULL, 't'},
   150         {"type",        required_argument, NULL, 't'},
   149         {"output-file", required_argument, NULL, 'o'},
   151         {"output-file", required_argument, NULL, 'o'},
       
   152         {"skin",        required_argument, NULL, 's'},
       
   153         {"emergency",   no_argument,       NULL, 'e'},
   150         {"force",       no_argument,       NULL, 'f'},
   154         {"force",       no_argument,       NULL, 'f'},
   151         {"quiet",       no_argument,       NULL, 'q'},
   155         {"quiet",       no_argument,       NULL, 'q'},
   152         {"verbose",     no_argument,       NULL, 'v'},
   156         {"verbose",     no_argument,       NULL, 'v'},
   153         {"help",        no_argument,       NULL, 'h'},
   157         {"help",        no_argument,       NULL, 'h'},
   154         {}
   158         {}
   155     };
   159     };
   156 
   160 
   157     do {
   161     do {
   158         c = getopt_long(argc, argv, "m:a:p:d:t:o:fqvh", longOptions, NULL);
   162         c = getopt_long(argc, argv, "m:a:p:d:t:o:s:efqvh", longOptions, NULL);
   159 
   163 
   160         switch (c) {
   164         switch (c) {
   161             case 'm':
   165             case 'm':
   162                 masters = optarg;
   166                 masters = optarg;
   163                 break;
   167                 break;
   178                 dataTypeStr = optarg;
   182                 dataTypeStr = optarg;
   179                 break;
   183                 break;
   180 
   184 
   181             case 'o':
   185             case 'o':
   182                 outputFile = optarg;
   186                 outputFile = optarg;
       
   187                 break;
       
   188 
       
   189             case 's':
       
   190                 skin = optarg;
       
   191                 break;
       
   192 
       
   193             case 'e':
       
   194                 emergency = true;
   183                 break;
   195                 break;
   184 
   196 
   185             case 'f':
   197             case 'f':
   186                 force = true;
   198                 force = true;
   187                 break;
   199                 break;
   306                     cmd->setAliases(aliases);
   318                     cmd->setAliases(aliases);
   307                     cmd->setPositions(positions);
   319                     cmd->setPositions(positions);
   308                     cmd->setDomains(domains);
   320                     cmd->setDomains(domains);
   309                     cmd->setDataType(dataTypeStr);
   321                     cmd->setDataType(dataTypeStr);
   310                     cmd->setOutputFile(outputFile);
   322                     cmd->setOutputFile(outputFile);
       
   323                     cmd->setSkin(skin);
       
   324                     cmd->setEmergency(emergency);
   311                     cmd->setForce(force);
   325                     cmd->setForce(force);
   312                     cmd->execute(commandArgs);
   326                     cmd->execute(commandArgs);
   313                 } catch (InvalidUsageException &e) {
   327                 } catch (InvalidUsageException &e) {
   314                     cerr << e.what() << endl << endl;
   328                     cerr << e.what() << endl << endl;
   315                     cerr << cmd->helpString(binaryBaseName);
   329                     cerr << cmd->helpString(binaryBaseName);