15 #include "../../include/ecl/command_line.hpp" 35 int main(
int argc,
char** argv) {
41 std::cout << std::endl;
42 std::cout <<
"***********************************************************" << std::endl;
43 std::cout <<
" Command Line Parsing" << std::endl;
44 std::cout <<
"***********************************************************" << std::endl;
45 std::cout << std::endl;
49 CmdLine cmd(
"This is a test program to test the command line parsing facilities provided by TCLAP.");
53 SwitchArg debugSwitch(
"d",
"debug",
"Enable debugging.");
59 ValueArg<int> intArg(
"i",
"integer",
"An integer argument for testing.",
false,5,
"integer");
76 cerr <<
"error: " << e.
error() <<
" for arg " << e.
argId() << endl;
79 cout <<
"Test Integer: " << test << endl;
81 cout <<
"Debug Switch (bool): true" << endl;
83 cout <<
"Debug Switch (bool): false" << endl;
85 std::cout <<
"Echoing unlabelled arg: " << nolabel << std::endl;
86 std::cout << std::endl;
int main(int argc, char **argv)
Defines the exception that is thrown whenever a command line is created and parsed.
Manages the command line parsing object.
std::string argId() const
std::string error() const
void parse(int argc, char **argv)