CoreComponents 3.0.0
A Modern C++ Toolkit
|
Command line arguments parser More...
#include <cc/Arguments>
Public Member Functions | |
Arguments (int argc, char *argv[]) | |
Read command line arguments and separate options from items. | |
List< String > | read (Out< Map< String, Variant > > options=None{}) |
Parse and validate command line options. | |
void | validate (const Map< String, Variant > &prototype) |
Check validity of command line arguments according to a prototype configuration. | |
void | override (InOut< Map< String, Variant > > config) const |
Override config with command line options. | |
Map< String, Variant > | options () const |
Command line options (e.g.: "x=1", "-x" or "--x") | |
List< String > | items () const |
Command line item arguments | |
String | execPath () const |
Execution path. | |
Command line arguments parser
Arguments | ( | int | argc, |
char * | argv[] ) |
Read command line arguments and separate options from items.
argc | Number of arguments |
argv | Argument values |
HelpRequest | Command line contains a help option (-h or --help) |
VersionRequest | Command line contains a version option (-v or --version) |
Parse and validate command line options.
UsageError | if a non-existing option or an option of invalid type is encountered |
Check validity of command line arguments according to a prototype configuration.
prototype | Prototype configuration |
UsageError | if a non-existing option or an option of invalid type is encountered |
Override config with command line options.
String execPath | ( | ) | const |
Execution path.