|
|
size_t | count () const |
| Count the total number of times an option was passed. More...
|
|
size_t | empty () const |
| True if the option was not passed. More...
|
|
| operator bool () const |
| This class is true if option is passed. More...
|
|
void | clear () |
| Clear the parsed results (mostly for testing) More...
|
|
|
Option * | expected (int value) |
| Set the number of expected arguments (Flags don't use this) More...
|
|
Option * | check (Validator validator, std::string validator_name="") |
| Adds a Validator with a built in type name. More...
|
|
Option * | check (std::function< std::string(const std::string &)> validator, std::string validator_description="", std::string validator_name="") |
| Adds a Validator. Takes a const string& and returns an error message (empty if conversion/check is okay). More...
|
|
Option * | transform (Validator validator, std::string validator_name="") |
| Adds a transforming validator with a built in type name. More...
|
|
Option * | transform (std::function< std::string(std::string)> func, std::string transform_description="", std::string transform_name="") |
| Adds a validator-like function that can change result. More...
|
|
Option * | each (std::function< void(std::string)> func) |
| Adds a user supplied function to run on each item passed in (communicate though lambda capture) More...
|
|
Validator * | get_validator (const std::string &validator_name="") |
| Get a named Validator. More...
|
|
Option * | needs (Option *opt) |
| Sets required options. More...
|
|
template<typename T = App> |
Option * | needs (std::string opt_name) |
| Can find a string if needed. More...
|
|
template<typename A , typename B , typename... ARG> |
Option * | needs (A opt, B opt1, ARG... args) |
| Any number supported, any mix of string and Opt. More...
|
|
bool | remove_needs (Option *opt) |
| Remove needs link from an option. Returns true if the option really was in the needs list. More...
|
|
Option * | excludes (Option *opt) |
| Sets excluded options. More...
|
|
template<typename T = App> |
Option * | excludes (std::string opt_name) |
| Can find a string if needed. More...
|
|
template<typename A , typename B , typename... ARG> |
Option * | excludes (A opt, B opt1, ARG... args) |
| Any number supported, any mix of string and Opt. More...
|
|
bool | remove_excludes (Option *opt) |
| Remove needs link from an option. Returns true if the option really was in the needs list. More...
|
|
Option * | envname (std::string name) |
| Sets environment variable to read if no option given. More...
|
|
template<typename T = App> |
Option * | ignore_case (bool value=true) |
|
template<typename T = App> |
Option * | ignore_underscore (bool value=true) |
|
Option * | multi_option_policy (MultiOptionPolicy value=MultiOptionPolicy::Throw) |
| Take the last argument if given multiple times (or another policy) More...
|
|
Option * | disable_flag_override (bool value=true) |
| disable flag overrides More...
|
|
|
int | get_type_size () const |
| The number of arguments the option expects. More...
|
|
std::string | get_envname () const |
| The environment variable associated to this value. More...
|
|
std::set< Option * > | get_needs () const |
| The set of options needed. More...
|
|
std::set< Option * > | get_excludes () const |
| The set of options excluded. More...
|
|
| __attribute__ ((deprecated("Use get_default_str() instead"))) std |
| The default value (for help printing) DEPRECATED Use get_default_str() instead. More...
|
|
|
std::string | get_name (bool positional=false, bool all_options=false) const |
| Gets a comma separated list of names. Will include / prefer the positional name if positional is true. If all_options is false, pick just the most descriptive name to show. Use get_name(true) to get the positional name (replaces get_pname ) More...
|
|
|
void | run_callback () |
| Process the callback. More...
|
|
bool | operator== (const Option &other) const |
| If options share any of the same names, they are equal (not counting positional) More...
|
|
bool | check_name (std::string name) const |
| Check a name. Requires "-" or "--" for short / long, supports positional name. More...
|
|
bool | check_sname (std::string name) const |
| Requires "-" to be removed from string. More...
|
|
bool | check_lname (std::string name) const |
| Requires "--" to be removed from string. More...
|
|
bool | check_fname (std::string name) const |
| Requires "--" to be removed from string. More...
|
|
std::string | get_flag_value (std::string name, std::string input_value) const |
|
Option * | add_result (std::string s) |
| Puts a result at the end. More...
|
|
Option * | add_result (std::string s, int &results_added) |
| Puts a result at the end and get a count of the number of arguments actually added. More...
|
|
Option * | add_result (std::vector< std::string > s) |
| Puts a result at the end. More...
|
|
std::vector< std::string > | results () const |
| Get a copy of the results. More...
|
|
template<typename T , enable_if_t<!is_vector< T >::value &&!std::is_const< T >::value, detail::enabler > = detail::dummy> |
void | results (T &output) const |
| get the results as a particular type More...
|
|
template<typename T > |
void | results (std::vector< T > &output) const |
| get the results as a vector of a particular type More...
|
|
template<typename T > |
T | as () const |
| return the results as a particular type More...
|
|
bool | get_callback_run () const |
| See if the callback has been run already. More...
|
|
Option * | group (std::string name) |
| Changes the group membership. More...
|
|
Option * | required (bool value=true) |
| Set the option as required. More...
|
|
Option * | mandatory (bool value=true) |
| Support Plumbum term. More...
|
|
Option * | always_capture_default (bool value=true) |
|
const std::string & | get_group () const |
| Get the group of this option. More...
|
|
bool | get_required () const |
| True if this is a required option. More...
|
|
bool | get_ignore_case () const |
| The status of ignore case. More...
|
|
bool | get_ignore_underscore () const |
| The status of ignore_underscore. More...
|
|
bool | get_configurable () const |
| The status of configurable. More...
|
|
bool | get_disable_flag_override () const |
| The status of configurable. More...
|
|
char | get_delimiter () const |
| Get the current delimeter char. More...
|
|
bool | get_always_capture_default () const |
| Return true if this will automatically capture the default value for help printing. More...
|
|
MultiOptionPolicy | get_multi_option_policy () const |
| The status of the multi option policy. More...
|
|
Option * | take_last () |
| Set the multi option policy to take last. More...
|
|
Option * | take_first () |
| Set the multi option policy to take last. More...
|
|
Option * | join () |
| Set the multi option policy to take last. More...
|
|
Option * | configurable (bool value=true) |
| Allow in a configuration file. More...
|
|
Option * | delimiter (char value='\0') |
| Allow in a configuration file. More...
|
|