Changeset 1632
- Timestamp:
- Nov 19, 2008, 5:20:49 PM (14 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/test/commandline_test.cc
r1629 r1632 77 77 OptionHelp help(cmd); 78 78 OptionArg<std::string> target(cmd, "T,target", "treat DEST as a normal file", 79 true, "TARGET"); 79 true); 80 target.print_arg("=TARGET"); 80 81 OptionSwitch verbose(cmd, "v,verbose", "explain what is being done"); 81 82 OptionSwitch version(cmd, "version", "output version and exit"); -
trunk/yat/utility/OptionArg.h
r1631 r1632 59 59 \param required If true option must be found in commandline or 60 60 exception is thrown in validation 61 \param arg string to be used in help output such as `=TARGET' in62 `--target=TARGET'. See print3(). New in yat 0.5.63 61 */ 64 62 OptionArg(CommandLine& cmd, std::string name, std::string desc, 65 bool required=false, std::string arg="") 66 : Option(cmd, name, desc), print_arg_(arg), required_(required) {} 63 bool required=false) 64 : Option(cmd, name, desc), required_(required) {} 65 66 /** 67 \param arg string to be used in help output such as `=TARGET' 68 in `--target=TARGET'. See print3(). 69 70 \since New in yat 0.5. 71 */ 72 void print_arg(std::string arg) { print_arg_ = arg; } 67 73 68 74 /**
Note: See TracChangeset
for help on using the changeset viewer.