arg
1.2
a C++ command-line parser
|
options to be parsed More...
#include <arg.hh>
Public Member Functions | |
Option (int key, std::string const &name) | |
command-line option with key and name More... | |
template<typename T > | |
Option & | stow (T &t) |
stow value to streamable variable | |
Option & | store (std::shared_ptr< Value > ptr=0) |
store value to "* ptr", the Value will be released by the Option | |
Option & | optional (std::string const &str="") |
value is optional defaulting to "str" | |
Option & | set (int *var, int value=- 1) |
set "* var" to "value" | |
Option & | set (bool &var, bool value=true) |
set "* var" to "value" | |
Option & | once (int init=0) |
can only be set once, with distinct value, "init" | |
Option & | call (CallBack *func, void *data) |
call function "* func" with "data" as extra argument | |
Option & | help (std::string const &text, std::string const &var="") |
help text | |
Option & | help_word (std::string const &var) |
help word | |
Option & | show_default (bool do_show=true) |
show default value in help | |
options to be parsed
Option::Option | ( | int | key, |
std::string const & | name | ||
) |
command-line option with key and name
key | unique single character key for the option |
name | name for the option |