- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/UIElements/CommandLineUI/CommandLineParser.cpp
rcfc53b r2a0a9e3 97 97 const OptionTrait* const currentOption = OptionRegistry::getInstance().getOptionByName(optioniter->first); 98 98 // add the option 99 std::cout << "Registering Option "100 << currentOption->getName()101 << " with type '" << currentOption->getTypeName() << "' "102 << " with description '" << currentOption->getDescription() << "' ";103 if (currentOption->hasShortForm())104 std::cout << ", with short form " << currentOption->getShortForm();105 else106 std::cout << ", with no short form ";107 if (currentOption->hasDefaultValue())108 std::cout << ", with default value " << currentOption->getDefaultValue();109 else110 std::cout << ", with no default value ";111 std::cout << std::endl;99 // std::cout << "Registering Option " 100 // << currentOption->getName() 101 // << " with type '" << currentOption->getTypeName() << "' " 102 // << " with description '" << currentOption->getDescription() << "' "; 103 // if (currentOption->hasShortForm()) 104 // std::cout << ", with short form " << currentOption->getShortForm(); 105 // else 106 // std::cout << ", with no short form "; 107 // if (currentOption->hasDefaultValue()) 108 // std::cout << ", with default value " << currentOption->getDefaultValue(); 109 // else 110 // std::cout << ", with no default value "; 111 // std::cout << std::endl; 112 112 113 113 AddOptionToParser(currentOption, (CmdParserLookup["options"])); … … 116 116 if (!ActionAlreadyAdded_flag) { 117 117 // add the action 118 std::cout << "Registering Action "119 << currentAction->Traits.getName()120 << " in menu " << currentAction->Traits.getMenuName()121 << " with type '" << currentAction->Traits.getTypeName() << "' "122 << " with description '" << currentAction->Traits.getDescription() << "' ";123 if (currentAction->Traits.hasShortForm())124 std::cout << ", with short form " << currentAction->Traits.getShortForm();125 else126 std::cout << ", with no short form ";127 if (currentAction->Traits.hasDefaultValue())128 std::cout << ", with default value " << currentAction->Traits.getDefaultValue();129 else130 std::cout << ", with no default value ";131 std::cout << std::endl;118 // std::cout << "Registering Action " 119 // << currentAction->Traits.getName() 120 // << " in menu " << currentAction->Traits.getMenuName() 121 // << " with type '" << currentAction->Traits.getTypeName() << "' " 122 // << " with description '" << currentAction->Traits.getDescription() << "' "; 123 // if (currentAction->Traits.hasShortForm()) 124 // std::cout << ", with short form " << currentAction->Traits.getShortForm(); 125 // else 126 // std::cout << ", with no short form "; 127 // if (currentAction->Traits.hasDefaultValue()) 128 // std::cout << ", with default value " << currentAction->Traits.getDefaultValue(); 129 // else 130 // std::cout << ", with no default value "; 131 // std::cout << std::endl; 132 132 133 133 ASSERT(CmdParserLookup.find(currentAction->Traits.getMenuName()) != CmdParserLookup.end(), … … 156 156 ASSERT(currentOption != NULL, "CommandLineParser::AddOptionToParser() - currentOption is NULL!"); 157 157 // add other options 158 std::cout << "Adding Action " << currentOption->getName() << " with type " << currentOption->getType()->name() << " and KeyandShortform " << currentOption->getKeyAndShortForm() << " to CommandLineParser." << std::endl;158 //std::cout << "Adding Action " << currentOption->getName() << " with type " << currentOption->getType()->name() << " and KeyandShortform " << currentOption->getKeyAndShortForm() << " to CommandLineParser." << std::endl; 159 159 switch(TypeToEnums.getEnumforType(currentOption->getType())) { 160 160 default: … … 369 369 { 370 370 std::map <std::string, std::string> ShortFormToActionMap = getShortFormToActionMap(); 371 DoLog(0) && (Log() << Verbose(0) << "Scanning command line arguments and recognizing Actions." << std::endl); 371 372 // go through all arguments 372 373 for (int i=1;i<argc;i++) { 373 (std::cout << Verbose(1) << "Checking on " << argv[i] << std::endl);374 DoLog(2) && (Log() << Verbose(2) << "Checking on " << argv[i] << std::endl); 374 375 // check whether they 375 376 if (argv[i][0] == '-') { // .. begin with - 376 (cout << Verbose(1) << "Possible argument: " << argv[i] << endl);377 DoLog(2) && (Log() << Verbose(2) << "Possible argument: " << argv[i] << endl); 377 378 if (argv[i][1] == '-') { // .. or -- 378 (cout<< Verbose(1) << "Putting " << argv[i] << " into the sequence." << endl);379 DoLog(1) && (Log() << Verbose(1) << "Putting " << argv[i] << " into the sequence." << endl); 379 380 SequenceOfActions.push_back(&(argv[i][2])); 380 381 // .. and check that next letter is not numeric, if so insert … … 382 383 std::map <std::string, std::string>::iterator iter = ShortFormToActionMap.find(&(argv[i][1])); 383 384 if (iter != ShortFormToActionMap.end()) { 384 (cout<< Verbose(1) << "Putting " << iter->second << " for " << iter->first << " into the sequence." << endl);385 DoLog(1) && (Log() << Verbose(1) << "Putting " << iter->second << " for " << iter->first << " into the sequence." << endl); 385 386 SequenceOfActions.push_back(iter->second); 386 387 } … … 404 405 * \return map from Action's ShortForm to token. 405 406 */ 406 std::map <std::string, std::string> CommandLineParser::getShortFormToActionMap() 407 std::map <std::string, std::string> CommandLineParser::getShortFormToActionMap() const 407 408 { 408 409 std::map <std::string, std::string> result;
Note:
See TracChangeset
for help on using the changeset viewer.