Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/UIElements/CommandLineUI/CommandLineParser.cpp

    rcfc53b r2a0a9e3  
    9797      const OptionTrait* const currentOption = OptionRegistry::getInstance().getOptionByName(optioniter->first);
    9898      // 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       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;
     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;
    112112
    113113      AddOptionToParser(currentOption, (CmdParserLookup["options"]));
     
    116116    if (!ActionAlreadyAdded_flag) {
    117117      // 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       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;
     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;
    132132
    133133      ASSERT(CmdParserLookup.find(currentAction->Traits.getMenuName()) != CmdParserLookup.end(),
     
    156156  ASSERT(currentOption != NULL, "CommandLineParser::AddOptionToParser() - currentOption is NULL!");
    157157  // 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;
    159159  switch(TypeToEnums.getEnumforType(currentOption->getType())) {
    160160    default:
     
    369369{
    370370  std::map <std::string, std::string> ShortFormToActionMap = getShortFormToActionMap();
     371  DoLog(0) && (Log() << Verbose(0) << "Scanning command line arguments and recognizing Actions." << std::endl);
    371372  // go through all arguments
    372373  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);
    374375    // check whether they
    375376    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);
    377378      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);
    379380        SequenceOfActions.push_back(&(argv[i][2]));
    380381        //  .. and check that next letter is not numeric, if so insert
     
    382383        std::map <std::string, std::string>::iterator iter = ShortFormToActionMap.find(&(argv[i][1]));
    383384        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);
    385386          SequenceOfActions.push_back(iter->second);
    386387        }
     
    404405 * \return map from Action's ShortForm to token.
    405406 */
    406 std::map <std::string, std::string> CommandLineParser::getShortFormToActionMap()
     407std::map <std::string, std::string> CommandLineParser::getShortFormToActionMap() const
    407408{
    408409  std::map <std::string, std::string> result;
Note: See TracChangeset for help on using the changeset viewer.