4 #include "../conversion/stringbuilder.h" 6 #include "../application/argumentparser.h" 7 #include "../application/argumentparserprivate.h" 8 #include "../application/commandlineutils.h" 9 #include "../application/failure.h" 10 #include "../application/fakeqtconfigarguments.h" 12 #include "../io/ansiescapecodes.h" 13 #include "../io/path.h" 15 #include "resources/config.h" 17 #include <cppunit/TestFixture.h> 18 #include <cppunit/extensions/HelperMacros.h> 36 CPPUNIT_TEST(testArgument);
37 CPPUNIT_TEST(testParsing);
38 CPPUNIT_TEST(testCallbacks);
39 CPPUNIT_TEST(testBashCompletion);
40 CPPUNIT_TEST(testHelp);
41 CPPUNIT_TEST(testSetMainArguments);
42 CPPUNIT_TEST_SUITE_END();
51 void testBashCompletion();
53 void testSetMainArguments();
74 Argument argument(
"test",
't',
"some description");
75 CPPUNIT_ASSERT_EQUAL(argument.
isRequired(),
false);
77 CPPUNIT_ASSERT_EQUAL(argument.
isRequired(),
true);
78 Argument subArg(
"sub",
's',
"sub arg");
80 CPPUNIT_ASSERT_EQUAL(subArg.parents().at(0), &argument);
81 CPPUNIT_ASSERT(!subArg.conflictsWithArgument());
84 setenv(
"FOO_ENV_VAR",
"foo",
true);
85 CPPUNIT_ASSERT(!strcmp(argument.
firstValue(),
"foo"));
87 occurrence.
values.emplace_back(
"bar");
88 argument.m_occurrences.emplace_back(move(occurrence));
89 CPPUNIT_ASSERT(!strcmp(argument.
firstValue(),
"bar"));
102 Argument verboseArg(
"verbose",
'v',
"be verbose");
104 Argument fileArg(
"file",
'f',
"specifies the path of the file to be opened");
108 Argument filesArg(
"files",
'f',
"specifies the path of the file(s) to be opened");
111 Argument outputFileArg(
"output-file",
'o',
"specifies the path of the output file");
116 Argument printFieldNamesArg(
"print-field-names",
'\0',
"prints available field names");
117 Argument displayFileInfoArg(
"display-file-info",
'i',
"displays general file information");
118 Argument notAlbumArg(
"album",
'a',
"should not be confused with album value");
120 displayFileInfoArg.
setSubArguments({ &fileArg, &verboseArg, ¬AlbumArg });
121 Argument fieldsArg(
"fields",
'\0',
"specifies the fields");
123 fieldsArg.
setValueNames({
"title",
"album",
"artist",
"trackpos" });
125 Argument displayTagInfoArg(
"get",
'p',
"displays the values of all specified tag fields (displays all fields if none specified)");
127 displayTagInfoArg.
setSubArguments({ &fieldsArg, &filesArg, &verboseArg, ¬AlbumArg });
129 parser.
setMainArguments({ &qtConfigArgs.qtWidgetsGuiArg(), &printFieldNamesArg, &displayTagInfoArg, &displayFileInfoArg, &helpArg, &noColorArg });
132 const char *argv[] = {
"tageditor",
"get",
"album",
"title",
"diskpos",
"-f",
"somefile" };
136 CPPUNIT_FAIL(
"Exception expected.");
138 CPPUNIT_ASSERT(!strcmp(e.
what(),
"The argument \"files\" can not be combined with \"fields\"."));
146 CPPUNIT_ASSERT(!qtConfigArgs.qtWidgetsGuiArg().isPresent());
147 CPPUNIT_ASSERT(!displayFileInfoArg.
isPresent());
148 CPPUNIT_ASSERT(!strcmp(parser.
executable(),
"tageditor"));
150 CPPUNIT_ASSERT(displayTagInfoArg.
isPresent());
152 CPPUNIT_ASSERT(!strcmp(fieldsArg.
values().at(0),
"album"));
153 CPPUNIT_ASSERT(!strcmp(fieldsArg.
values().at(1),
"title"));
154 CPPUNIT_ASSERT(!strcmp(fieldsArg.
values().at(2),
"diskpos"));
155 CPPUNIT_ASSERT_THROW(displayTagInfoArg.
values().at(3), out_of_range);
158 const char *argv2[] = {
"tageditor",
"",
"-p",
"album",
"title",
"diskpos",
"",
"--files",
"somefile" };
163 CPPUNIT_ASSERT(!qtConfigArgs.qtWidgetsGuiArg().isPresent());
164 CPPUNIT_ASSERT(!displayFileInfoArg.
isPresent());
166 CPPUNIT_ASSERT(displayTagInfoArg.
isPresent());
168 CPPUNIT_ASSERT(!strcmp(fieldsArg.
values().at(0),
"album"));
169 CPPUNIT_ASSERT(!strcmp(fieldsArg.
values().at(1),
"title"));
170 CPPUNIT_ASSERT(!strcmp(fieldsArg.
values().at(2),
"diskpos"));
171 CPPUNIT_ASSERT(!strcmp(fieldsArg.
values().at(3),
""));
172 CPPUNIT_ASSERT_THROW(fieldsArg.
values().at(4), out_of_range);
174 CPPUNIT_ASSERT(!strcmp(filesArg.
values().at(0),
"somefile"));
177 const char *argv3[] = {
"tageditor",
"album",
"title",
"diskpos",
"--files",
"somefile" };
181 CPPUNIT_FAIL(
"Exception expected.");
183 CPPUNIT_ASSERT_EQUAL(
"The specified argument \"album\" is unknown."s,
string(e.
what()));
190 streambuf *regularCerrBuffer = cerr.rdbuf(buffer.rdbuf());
196 cerr.rdbuf(regularCerrBuffer);
199 cerr.rdbuf(regularCerrBuffer);
200 CPPUNIT_ASSERT_EQUAL(
"Warning: The specified argument \"album\" is unknown and will be ignored.\n"s
201 "Warning: The specified argument \"title\" is unknown and will be ignored.\n"s
202 "Warning: The specified argument \"diskpos\" is unknown and will be ignored.\n"s
203 "Warning: The specified argument \"--files\" is unknown and will be ignored.\n"s
204 "Warning: The specified argument \"somefile\" is unknown and will be ignored.\n"s,
207 CPPUNIT_ASSERT(!qtConfigArgs.qtWidgetsGuiArg().isPresent());
208 CPPUNIT_ASSERT(!displayFileInfoArg.
isPresent());
209 CPPUNIT_ASSERT(!displayTagInfoArg.
isPresent());
214 const char *argv4[] = {
"tageditor",
"-i",
"-vf",
"test" };
218 CPPUNIT_ASSERT(!qtConfigArgs.qtWidgetsGuiArg().isPresent());
219 CPPUNIT_ASSERT(displayFileInfoArg.
isPresent());
221 CPPUNIT_ASSERT(!displayTagInfoArg.
isPresent());
224 CPPUNIT_ASSERT(!strcmp(fileArg.
values().at(0),
"test"));
225 CPPUNIT_ASSERT_THROW(fileArg.
values().at(1), out_of_range);
231 CPPUNIT_FAIL(
"Exception expected.");
233 CPPUNIT_ASSERT(!qtConfigArgs.qtWidgetsGuiArg().isPresent());
234 CPPUNIT_ASSERT(!strcmp(e.
what(),
"The argument \"verbose\" mustn't be specified more than 1 time."));
241 CPPUNIT_ASSERT(!qtConfigArgs.qtWidgetsGuiArg().isPresent());
247 CPPUNIT_ASSERT(!qtConfigArgs.qtWidgetsGuiArg().isPresent());
250 const char *argv5[] = {
"tageditor",
"-i",
"-f",
"test" };
254 CPPUNIT_FAIL(
"Exception expected.");
256 CPPUNIT_ASSERT(!qtConfigArgs.qtWidgetsGuiArg().isPresent());
257 CPPUNIT_ASSERT(!strcmp(e.
what(),
"The argument \"verbose\" must be specified at least 1 time."));
262 const char *argv10[] = {
"tageditor",
"-pf",
"test" };
265 CPPUNIT_ASSERT(displayTagInfoArg.
isPresent());
266 CPPUNIT_ASSERT(!displayFileInfoArg.
isPresent());
269 CPPUNIT_ASSERT_EQUAL(1_st, filesArg.
values(0).size());
270 CPPUNIT_ASSERT(!strcmp(filesArg.
values(0).front(),
"test"));
271 CPPUNIT_ASSERT(!qtConfigArgs.qtWidgetsGuiArg().isPresent());
274 const char *argv6[] = {
"tageditor",
"-g" };
277 CPPUNIT_ASSERT(qtConfigArgs.qtWidgetsGuiArg().isPresent());
280 const char *argv7[] = {
"tageditor",
"-f",
"test" };
284 CPPUNIT_FAIL(
"Exception expected.");
286 CPPUNIT_ASSERT(!qtConfigArgs.qtWidgetsGuiArg().isPresent());
287 CPPUNIT_ASSERT_EQUAL(
"The specified argument \"-f\" is unknown."s,
string(e.
what()));
291 const char *argv11[] = {
"tageditor",
"-if=test-v" };
297 CPPUNIT_ASSERT_EQUAL(1_st, fileArg.
values(0).size());
298 CPPUNIT_ASSERT_EQUAL(
"test-v"s,
string(fileArg.
values(0).front()));
299 const char *argv15[] = {
"tageditor",
"-i",
"--file=test",
"-v" };
305 CPPUNIT_ASSERT_EQUAL(1_st, fileArg.
values(0).size());
306 CPPUNIT_ASSERT_EQUAL(
"test"s,
string(fileArg.
values(0).front()));
309 const char *argv12[] = {
"tageditor",
"-iftest" };
314 CPPUNIT_ASSERT_EQUAL(1_st, fileArg.
values(0).size());
315 CPPUNIT_ASSERT(!strcmp(fileArg.
values(0).front(),
"test"));
318 const char *argv17[] = {
"tageditor",
"-if=test-v",
"--no-color" };
325 CPPUNIT_ASSERT_EQUAL(1_st, fileArg.
values(0).size());
326 CPPUNIT_ASSERT_EQUAL(
"test-v"s,
string(fileArg.
values(0).front()));
329 const char *argv8[] = {
"tageditor" };
332 CPPUNIT_ASSERT(qtConfigArgs.qtWidgetsGuiArg().isPresent());
333 CPPUNIT_ASSERT(!displayFileInfoArg.
isPresent());
335 CPPUNIT_ASSERT(!displayTagInfoArg.
isPresent());
338 if (getenv(
"PATH")) {
340 CPPUNIT_ASSERT(!strcmp(fileArg.
firstValue(), getenv(
"PATH")));
346 const char *argv13[] = {
"tageditor",
"get",
"--fields",
"album=test",
"title",
"diskpos",
"--files",
"somefile" };
351 CPPUNIT_ASSERT(!qtConfigArgs.qtWidgetsGuiArg().isPresent());
352 CPPUNIT_ASSERT(!displayFileInfoArg.
isPresent());
354 CPPUNIT_ASSERT(displayTagInfoArg.
isPresent());
356 CPPUNIT_ASSERT(!strcmp(fieldsArg.
values().at(0),
"album=test"));
357 CPPUNIT_ASSERT(!strcmp(fieldsArg.
values().at(1),
"title"));
358 CPPUNIT_ASSERT(!strcmp(fieldsArg.
values().at(2),
"diskpos"));
359 CPPUNIT_ASSERT_THROW(fieldsArg.
values().at(3), out_of_range);
361 CPPUNIT_ASSERT(!strcmp(filesArg.
values().at(0),
"somefile"));
362 CPPUNIT_ASSERT(!notAlbumArg.
isPresent());
365 const char *argv9[] = {
"tageditor",
"-p",
"album",
"title",
"diskpos" };
370 CPPUNIT_FAIL(
"Exception expected.");
372 CPPUNIT_ASSERT(!qtConfigArgs.qtWidgetsGuiArg().isPresent());
373 CPPUNIT_ASSERT_EQUAL(
374 "Not all parameter for argument \"fields\" provided. You have to provide the following parameter: title album artist trackpos"s,
379 const char *argv16[] = {
"tageditor",
"--hel",
"-p",
"album",
"title",
"diskpos" };
384 CPPUNIT_FAIL(
"Exception expected.");
386 CPPUNIT_ASSERT(!qtConfigArgs.qtWidgetsGuiArg().isPresent());
387 CPPUNIT_ASSERT_EQUAL(
"The specified argument \"--hel\" is unknown."s,
string(e.
what()));
391 const char *argv14[] = {
"tageditor",
"get",
"fields",
"album=test",
"-f",
"somefile" };
395 CPPUNIT_ASSERT(displayTagInfoArg.
isPresent());
397 CPPUNIT_ASSERT(!strcmp(fieldsArg.
values().at(0),
"album=test"));
403 CPPUNIT_ASSERT(displayTagInfoArg.
isPresent());
405 CPPUNIT_ASSERT(!strcmp(fieldsArg.
values().at(0),
"fields"));
406 CPPUNIT_ASSERT(!strcmp(fieldsArg.
values().at(1),
"album=test"));
415 Argument callbackArg(
"with-callback",
't',
"callback test");
418 CPPUNIT_ASSERT_EQUAL(0_st, occurrence.
index);
419 CPPUNIT_ASSERT(occurrence.
path.empty());
420 CPPUNIT_ASSERT_EQUAL(2_st, occurrence.
values.size());
421 CPPUNIT_ASSERT(!strcmp(occurrence.
values[0],
"val1"));
422 CPPUNIT_ASSERT(!strcmp(occurrence.
values[1],
"val2"));
425 Argument noCallbackArg(
"no-callback",
'l',
"callback test");
430 const char *argv[] = {
"test",
"-t",
"val1",
"val2" };
434 CPPUNIT_ASSERT_EQUAL(i, 42);
439 const char *argv2[] = {
"test",
"-l",
"val1",
"val2" };
446 static bool exitCalled =
false;
456 Argument verboseArg(
"verbose",
'v',
"be verbose");
458 Argument filesArg(
"files",
'f',
"specifies the path of the file(s) to be opened");
461 Argument nestedSubArg(
"nested-sub",
'\0',
"nested sub arg");
462 Argument subArg(
"sub",
'\0',
"sub arg");
464 Argument displayFileInfoArg(
"display-file-info",
'i',
"displays general file information");
466 displayFileInfoArg.
setSubArguments({ &filesArg, &verboseArg, &subArg });
467 Argument fieldsArg(
"fields",
'\0',
"specifies the fields");
471 Argument valuesArg(
"values",
'\0',
"specifies the fields");
475 valuesArg.
setValueCompletionBehavior(ValueCompletionBehavior::PreDefinedValues | ValueCompletionBehavior::AppendEquationSign);
476 Argument getArg(
"get",
'g',
"gets tag values");
478 Argument setArg(
"set",
's',
"sets tag values");
481 parser.
setMainArguments({ &helpArg, &displayFileInfoArg, &getArg, &setArg });
484 const char *
const argv1[] = {
"se" };
489 parser.printBashCompletion(1, argv1, 0, reader);
498 parser.printBashCompletion(1, argv1, 0, reader);
502 const char *
const argv2[] = {
"set" };
507 parser.printBashCompletion(1, argv2, 0, reader);
513 const OutputCheck c(
"COMPREPLY=('--files' '--values' )\n");
515 parser.printBashCompletion(1, argv2, 1, reader);
522 const OutputCheck c(
"COMPREPLY=('files' '--values' )\n");
524 parser.printBashCompletion(1, argv2, 1, reader);
531 const OutputCheck c(
"COMPREPLY=('display-file-info' 'get' 'set' '--help' )\n");
533 parser.printBashCompletion(0,
nullptr, 0, reader);
537 const char *
const argv3[] = {
"get",
"--fields" };
540 const OutputCheck c(
"COMPREPLY=('title' 'album' 'artist' 'trackpos' '--files' )\n");
542 parser.printBashCompletion(2, argv3, 2, reader);
546 const char *
const argv4[] = {
"set",
"--values",
"a" };
549 const OutputCheck c(
"COMPREPLY=('album=' 'artist=' ); compopt -o nospace\n");
551 parser.printBashCompletion(3, argv4, 2, reader);
557 const OutputCheck c(
"COMPREPLY=('title' 'album' 'artist' 'trackpos' '--fields' '--files' )\n");
559 parser.printBashCompletion(1, argv3, 2, reader);
564 iniFilePath.resize(iniFilePath.size() - 4);
566 mkvFilePath.resize(mkvFilePath.size() - 17);
568 const char *
const argv5[] = {
"get",
"--files", iniFilePath.c_str() };
571 const OutputCheck c(
"COMPREPLY=('" % mkvFilePath %
" '\"'\"'with quote'\"'\"'.mkv' '" % iniFilePath +
".ini' ); compopt -o filenames\n",
572 "COMPREPLY=('" % iniFilePath %
".ini' '" % mkvFilePath +
" '\"'\"'with quote'\"'\"'.mkv' ); compopt -o filenames\n");
574 parser.printBashCompletion(3, argv5, 2, reader);
578 const char *
const argv6[] = {
"set",
"--" };
581 const OutputCheck c(
"COMPREPLY=('--files' '--values' )\n");
583 parser.printBashCompletion(2, argv6, 1, reader);
587 const char *
const argv7[] = {
"-i",
"--sub",
"--" };
590 const OutputCheck c(
"COMPREPLY=('--files' '--nested-sub' '--verbose' )\n");
592 parser.printBashCompletion(3, argv7, 2, reader);
596 const char *
const argv8[] = {
"set",
"--values",
"t" };
599 const OutputCheck c(
"COMPREPLY=('title=' 'trackpos=' ); compopt -o nospace\n");
601 parser.printBashCompletion(3, argv8, 2, reader);
605 const char *
const argv9[] = {
"-gf" };
610 parser.printBashCompletion(1, argv9, 0, reader);
614 const OutputCheck c([](
const string &actualOutput) { CPPUNIT_ASSERT_EQUAL(0_st, actualOutput.find(
"COMPREPLY=('--fields' ")); });
616 parser.printBashCompletion(1, argv9, 1, reader);
623 const char *
const argv10[] = {
"/some/path/tageditor",
"--bash-completion-for",
"0" };
626 const OutputCheck c(
"COMPREPLY=('display-file-info' 'get' 'set' '--help' )\n");
629 CPPUNIT_ASSERT(!strcmp(
"/some/path/tageditor", parser.
executable()));
630 CPPUNIT_ASSERT(exitCalled);
633 const char *
const argv11[] = {
"/some/path/tageditor",
"--bash-completion-for",
"ge" };
649 CPPUNIT_ASSERT_EQUAL(static_cast<unsigned char>(4 + 3), indent.
level);
655 OperationArgument verboseArg(
"verbose",
'v',
"be verbose",
"actually not an operation");
657 ConfigValueArgument nestedSubArg(
"nested-sub",
'\0',
"nested sub arg", {
"value1",
"value2" });
659 Argument subArg(
"sub",
'\0',
"sub arg");
662 Argument filesArg(
"files",
'f',
"specifies the path of the file(s) to be opened");
666 Argument envArg(
"env",
'\0',
"env");
677 const char *
const argv[] = {
"app",
"-h" };
679 const OutputCheck c(
"\e[1m" APP_NAME
", version " APP_VERSION
"\n" 680 "\e[0mLinked against: somelib, some other lib\n" 682 "Available arguments:\n" 683 "\e[1m--help, -h\e[0m\n" 684 " shows this information\n" 685 " particularities: mandatory\n" 687 "\e[1mverbose, -v\e[0m\n" 689 " example: actually not an operation\n" 691 "\e[1m--files, -f\e[0m\n" 692 " specifies the path of the file(s) to be opened\n" 695 " particularities: mandatory if parent argument is present\n" 696 " \e[1m--nested-sub\e[0m [value1] [value2] ...\n" 699 "\e[1m--env\e[0m [file] [value 2]\n" 701 " default environment variable: FILES\n" 703 "Project website: " APP_URL
"\n");
716 Argument subArg(
"sub-arg",
's',
"mandatory sub arg");
721 CPPUNIT_ASSERT_MESSAGE(
"clear main args", parser.
mainArguments().empty());
723 CPPUNIT_ASSERT_MESSAGE(
"no default due to required sub arg", !parser.
defaultArgument());
726 CPPUNIT_ASSERT_MESSAGE(
"default if no required sub arg", &helpArg == parser.
defaultArgument());
void testBashCompletion()
Tests bash completion.
void resetArgs()
Resets all Argument instances assigned as mainArguments() and sub arguments.
#define QT_CONFIG_ARGUMENTS
The ConfigValueArgument class is an Argument where setCombinable() is true by default.
Argument * defaultArgument() const
Returns the default argument.
void setImplicit(bool value)
Sets whether the argument is an implicit argument.
std::size_t index
The index of the occurrence.
void testParsing()
Tests parsing command line arguments.
void setCombinable(bool value)
Sets whether this argument can be combined.
void setUnknownArgumentBehavior(UnknownArgumentBehavior behavior)
Sets how unknown arguments are treated.
void readArgs(int argc, const char *const *argv)
Parses the specified command line arguments.
virtual const char * what() const USE_NOTHROW
Returns a C-style character string describing the cause of the Failure.
Contains currently only ArgumentParser and related classes.
void setMainArguments(const ArgumentInitializerList &mainArguments)
Sets the main arguments for the parser.
void testArgument()
Tests the behaviour of the argument class.
void testSetMainArguments()
Tests some corner cases in setMainArguments() which are not already checked in the other tests...
bool isRequired() const
Returns an indication whether the argument is mandatory.
void testCallbacks()
Tests whether callbacks are called correctly.
void setRequired(bool required)
Sets whether this argument is mandatory or not.
Contains literals to ease asserting with CPPUNIT_ASSERT_EQUAL.
void parseArgs(int argc, const char *const *argv)
Parses the specified command line arguments.
const char * firstValue() const
Returns the first parameter value of the first occurrence of the argument.
The Indentation class allows printing indentation conveniently, eg.
The NoColorArgument class allows to specify whether use of escape codes or similar technique to provi...
void addMainArgument(Argument *argument)
Adds the specified argument to the main argument.
The ArgumentParserTests class tests the ArgumentParser and Argument classes.
The OperationArgument class is an Argument where denotesOperation() is true by default.
void setConstraints(std::size_t minOccurrences, std::size_t maxOccurrences)
Sets the allowed number of occurrences.
Contains classes and functions utilizing creating of test applications.
CPP_UTILITIES_EXPORT bool enabled
Controls whether the functions inside the EscapeCodes namespace actually make use of escape codes...
void setValueCompletionBehavior(ValueCompletionBehavior valueCompletionBehaviour)
Sets the items to be considered when generating completion for the values.
#define SET_APPLICATION_INFO
Sets application meta data (including SET_DEPENDENCY_INFO) used by ArgumentParser::printHelp().
void appendValueName(const char *valueName)
Appends a value name.
CPP_UTILITIES_EXPORT std::initializer_list< const char * > dependencyVersions
Specifies the dependency versions the application was linked against (used by ArgumentParser::printHe...
const std::vector< const char * > & values(std::size_t occurrence=0) const
Returns the parameter values for the specified occurrence of argument.
Contains several functions providing conversions between different data types.
CPP_UTILITIES_EXPORT void(* exitFunction)(int)
Specifies a function quit the application.
const char * executable() const
Returns the name of the current executable.
The Argument class is a wrapper for command line argument information.
void setCallback(CallbackFunction callback)
Sets a callback function which will be called by the parser if the argument could be found and no par...
void setPreDefinedCompletionValues(const char *preDefinedCompletionValues)
Assignes the values to be used when generating completion for the values.
ApplicationUtilities::ArgumentReader & reset(const char *const *argv, const char *const *end)
Resets the ArgumentReader to continue reading new argv.
std::vector< Argument * > path
The "path" of the occurrence (the parent elements which have been specified before).
The StandardOutputCheck class asserts whether the (standard) output written in the enclosing code blo...
void addSubArgument(Argument *arg)
Adds arg as a secondary argument for this argument.
void setEnvironmentVariable(const char *environmentVariable)
Sets the environment variable queried when firstValue() is called.
The ArgumentOccurrence struct holds argument values for an occurrence of an argument.
bool isPresent() const
Returns an indication whether the argument could be detected when parsing.
The HelpArgument class prints help information for an argument parser when present (–help...
CPPUNIT_TEST_SUITE_REGISTRATION(ArgumentParserTests)
The Failure class is thrown by an ArgumentParser when a parsing error occurs.
const ArgumentVector & mainArguments() const
Returns the main arguments.
void setDenotesOperation(bool denotesOperation)
Sets whether the argument denotes the operation.
void reset()
Resets occurrences (indices, values and paths).
void setRequiredValueCount(std::size_t requiredValueCount)
Sets the number of values which are required to be given for this argument.
The ArgumentReader class internally encapsulates the process of reading command line arguments...
void setSubArguments(const ArgumentInitializerList &subArguments)
Sets the secondary arguments for this arguments.
void read()
Reads the commands line arguments specified when constructing the object.
CPP_UTILITIES_EXPORT std::string testFilePath(const std::string &name)
Convenience function which returns the full path of the test file with the specified name...
The ArgumentParser class provides a means for handling command line arguments.
void testHelp()
Tests –help output.
void setValueNames(std::initializer_list< const char *> valueNames)
Sets the names of the requried values.
std::vector< const char * > values
The parameter values which have been specified after the occurrence of the argument.