Changeset 37:ac4d260c35da in rrlib_getopt


Ignore:
Timestamp:
08.05.2017 18:30:07 (4 years ago)
Author:
Max Reichardt <mreichardt@…>
Branch:
14.08
Phase:
public
Message:

Adds missing parameter to AddValue() to define whether an option can be set more than once

Files:
2 edited

Legend:

Unmodified
Added
Removed
  • parser.cpp

    r29 r37  
    308308// AddValue 
    309309//---------------------------------------------------------------------- 
    310 const tOption AddValue(const char *long_name, const char short_name, const  char *help, tHandler handler) 
    311 { 
    312   return AddOption(tOption(new tValue(long_name, short_name, help)), handler); 
     310const tOption AddValue(const char *long_name, const char short_name, const  char *help, tHandler handler, bool restrict_to_single_occurrence) 
     311{ 
     312  return AddOption(tOption(new tValue(long_name, short_name, help, restrict_to_single_occurrence)), handler); 
    313313} 
    314314 
  • parser.h

    r29 r37  
    8282const tOption AddCounter(const char *long_name, const char short_name, const char *help, tHandler handler); 
    8383 
    84 const tOption AddValue(const char *long_name, const char short_name, const char *help, tHandler handler); 
     84const tOption AddValue(const char *long_name, const char short_name, const char *help, tHandler handler, bool restrict_to_single_occurrence = false); 
    8585 
    8686std::vector<std::string> ProcessCommandLine(size_t argc, char **argv, 
Note: See TracChangeset for help on using the changeset viewer.