CepGen 1.2.5
Central exclusive processes event generator
|
A generic command line arguments parser. More...
#include <CepGen/Utils/ArgumentsParser.h>
Public Member Functions | |
ArgumentsParser (int argc, char *argv[]) | |
Arguments parser constructor. | |
template<typename... Args> | |
ArgumentsParser & | addArgument (Args &&... args) |
Add a parameter required for the parser. | |
template<typename... Args> | |
ArgumentsParser & | addOptionalArgument (Args &&... args) |
Add a non-mandatory parameters that can be parsed. | |
ArgumentsParser & | parse () |
Associate command-line arguments to parameters. | |
std::string | operator[] (std::string name) const |
Read required and optional parameters. | |
void | dump () const |
Dump the list of arguments into the terminal. | |
void | print_help () const |
Show usage. | |
void | print_version () const |
Show version. | |
std::string | help_message () const |
Usage message. | |
bool | debugging () const |
Is the debugging flag set? Extra configuration flags in arguments? | |
const std::vector< std::string > & | extra_config () const |
ArgumentsParser | ( | int | argc, |
char * | argv[] | ||
) |
[in] | argc | Number of argument words (key + value) to be parsed |
[in] | argv[] | List of argument words (key + value) to be parsed |
Definition at line 31 of file ArgumentsParser.cpp.
ArgumentsParser & addArgument | ( | Args &&... | args | ) |
Definition at line 39 of file ArgumentsParser.h.
ArgumentsParser & addOptionalArgument | ( | Args &&... | args | ) |
Definition at line 46 of file ArgumentsParser.h.
bool debugging | ( | ) | const |
Definition at line 57 of file ArgumentsParser.h.
void dump | ( | ) | const |
Definition at line 97 of file ArgumentsParser.cpp.
const std::vector< std::string > & extra_config | ( | ) | const |
Definition at line 59 of file ArgumentsParser.h.
std::string help_message | ( | ) | const |
Definition at line 170 of file ArgumentsParser.cpp.
std::string operator[] | ( | std::string | name | ) | const |
Definition at line 159 of file ArgumentsParser.cpp.
ArgumentsParser & parse | ( | ) |
Definition at line 106 of file ArgumentsParser.cpp.
void print_help | ( | ) | const |
Definition at line 93 of file ArgumentsParser.cpp.
void print_version | ( | ) | const |
Definition at line 95 of file ArgumentsParser.cpp.