Go to the source code of this file.
|
int | main (int argc, char **argv) |
|
int main |
( |
int |
argc, |
|
|
char ** |
argv |
|
) |
| |
Definition at line 30 of file gtestCmdLnArg.cxx.
References genie::CmdLnArgParser::Arg(), genie::CmdLnArgParser::ArgAsDouble(), genie::CmdLnArgParser::ArgAsLong(), genie::CmdLnArgParser::ArgAsStringTokens(), LOG, genie::CmdLnArgParser::OptionExists(), and pNOTICE.
35 <<
"Option -f exists? " << parser.OptionExists(
'f');
37 <<
"Option -s exists? " << parser.OptionExists(
's');
39 if(parser.OptionExists(
'd')) {
41 <<
"Command line argument following -d : "
44 <<
"Command line argument following -d (as double): "
45 << parser.ArgAsDouble(
'd');
48 if(parser.OptionExists(
'l')) {
50 <<
"Command line argument following -l : "
53 <<
"Command line argument following -l (as long int): "
54 << parser.ArgAsLong(
'l');
57 if(parser.OptionExists(
'v')) {
59 <<
"Command line argument following -v : "
61 vector<string> tokens = parser.ArgAsStringTokens(
'v',
",");
62 vector<string>::const_iterator iter = tokens.begin();
63 for( ; iter != tokens.end(); ++iter) {
65 <<
"Token: " << *iter;
69 if(parser.OptionExists(
"with-long-command-line-option")) {
71 <<
"Command line argument following --with-long-command-line-option : "
72 << parser.Arg(
"with-long-command-line-option");
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
Command line argument parser.