arg
1.2
a C++ command-line parser
|
The command-line parser. More...
#include <arg.hh>
Public Member Functions | |
void | add_help (std::string const &msg) |
add additional help text between option helps | |
Option & | add_opt (int key, std::string const &name="", bool hide=false) |
add an Option | |
Option & | add_opt (std::string const &name, bool hide=false) |
add an Option without a specified key | |
Option & | get_opt (std::string const &name) |
get an existing Option | |
std::vector< std::string > & | args () |
void | parse (int argc, char *argv[], bool ignore_unknown=false) |
perform command-line parsing More... | |
void | set_header (std::string const &text) |
set the header in help | |
std::string const & | get_header () const |
get the header text of help | |
Protected Attributes | |
std::string | prog_name |
name to identify the program | |
The command-line parser.
vector< string > & Parser::args | ( | ) |
get the argument list
void Parser::parse | ( | int | argc, |
char * | argv[], | ||
bool | ignore_unknown = false |
||
) |
perform command-line parsing
argc | count of command-line tokens |
argv | c-string array of command-line tokens |
ignore_unknown | whether to ignore unknown options |