|
|
|
| Option (const Option &)=delete |
| |
|
Option & | operator= (const Option &)=delete |
| |
|
CLI11_NODISCARD std::size_t | count () const |
| | Count the total number of times an option was passed.
|
| |
|
CLI11_NODISCARD bool | empty () const |
| | True if the option was not passed.
|
| |
|
| operator bool () const |
| | This bool operator returns true if any arguments were passed or the option callback is forced.
|
| |
|
void | clear () |
| | Clear the parsed results (mostly for testing)
|
| |
|
|
Option * | expected (int value) |
| | Set the number of expected arguments.
|
| |
|
Option * | expected (int value_min, int value_max) |
| | Set the range of expected arguments.
|
| |
| Option * | allow_extra_args (bool value=true) |
| |
|
CLI11_NODISCARD bool | get_allow_extra_args () const |
| | Get the current value of allow extra args.
|
| |
|
Option * | trigger_on_parse (bool value=true) |
| | Set the value of trigger_on_parse which specifies that the option callback should be triggered on every parse.
|
| |
|
CLI11_NODISCARD bool | get_trigger_on_parse () const |
| | The status of trigger on parse.
|
| |
|
Option * | force_callback (bool value=true) |
| | Set the value of force_callback.
|
| |
|
CLI11_NODISCARD bool | get_force_callback () const |
| | The status of force_callback.
|
| |
| Option * | run_callback_for_default (bool value=true) |
| |
|
CLI11_NODISCARD bool | get_run_callback_for_default () const |
| | Get the current value of run_callback_for_default.
|
| |
| Option * | callback_priority (CallbackPriority value=CallbackPriority::Normal) |
| |
|
Option * | check (Validator_p validator) |
| | Adds a shared validator.
|
| |
|
Option * | check (Validator validator, const std::string &validator_name="") |
| | Adds a Validator with a built in type name.
|
| |
|
Option * | check (std::function< std::string(const std::string &)> validator_func, 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).
|
| |
|
Option * | transform (Validator_p validator) |
| | Adds a shared Validator.
|
| |
|
Option * | transform (Validator validator, const std::string &transform_name="") |
| | Adds a transforming Validator with a built in type name.
|
| |
|
Option * | transform (const std::function< std::string(std::string)> &transform_func, std::string transform_description="", std::string transform_name="") |
| | Adds a Validator-like function that can change result.
|
| |
|
Option * | each (const std::function< void(std::string)> &func) |
| | Adds a user supplied function to run on each item passed in (communicate though lambda capture)
|
| |
|
Validator * | get_validator (const std::string &validator_name="") |
| | Get a named Validator.
|
| |
|
Validator * | get_validator (int index) |
| | Get a Validator by index NOTE: this may not be the order of definition.
|
| |
|
Option * | needs (Option *opt) |
| | Sets required options.
|
| |
|
template<typename T = App> |
| Option * | needs (std::string opt_name) |
| | Can find a string if needed.
|
| |
|
template<typename A , typename B , typename... ARG> |
| Option * | needs (A opt, B opt1, ARG... args) |
| | Any number supported, any mix of string and Opt.
|
| |
|
bool | remove_needs (Option *opt) |
| | Remove needs link from an option. Returns true if the option really was in the needs list.
|
| |
|
Option * | excludes (Option *opt) |
| | Sets excluded options.
|
| |
|
template<typename T = App> |
| Option * | excludes (std::string opt_name) |
| | Can find a string if needed.
|
| |
|
template<typename A , typename B , typename... ARG> |
| Option * | excludes (A opt, B opt1, ARG... args) |
| | Any number supported, any mix of string and Opt.
|
| |
|
bool | remove_excludes (Option *opt) |
| | Remove needs link from an option. Returns true if the option really was in the needs list.
|
| |
|
Option * | envname (std::string name) |
| | Sets environment variable to read if no option given.
|
| |
| 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)
|
| |
|
Option * | disable_flag_override (bool value=true) |
| | Disable flag overrides values, e.g. –flag=is not allowed.
|
| |
|
|
CLI11_NODISCARD int | get_type_size () const |
| | The number of arguments the option expects.
|
| |
|
CLI11_NODISCARD int | get_type_size_min () const |
| | The minimum number of arguments the option expects.
|
| |
|
CLI11_NODISCARD int | get_type_size_max () const |
| | The maximum number of arguments the option expects.
|
| |
|
CLI11_NODISCARD bool | get_inject_separator () const |
| | Return the inject_separator flag.
|
| |
|
CLI11_NODISCARD std::string | get_envname () const |
| | The environment variable associated to this value.
|
| |
|
CLI11_NODISCARD std::set< Option * > | get_needs () const |
| | The set of options needed.
|
| |
|
CLI11_NODISCARD std::set< Option * > | get_excludes () const |
| | The set of options excluded.
|
| |
|
CLI11_NODISCARD std::string | get_default_str () const |
| | The default value (for help printing)
|
| |
|
CLI11_NODISCARD callback_t | get_callback () const |
| | Get the callback function.
|
| |
|
CLI11_NODISCARD const std::vector< std::string > & | get_lnames () const |
| | Get the long names.
|
| |
|
CLI11_NODISCARD const std::vector< std::string > & | get_snames () const |
| | Get the short names.
|
| |
|
CLI11_NODISCARD const std::vector< std::string > & | get_fnames () const |
| | Get the flag names with specified default values.
|
| |
|
CLI11_NODISCARD const std::string & | get_single_name () const |
| | Get a single name for the option, first of lname, sname, pname, envname.
|
| |
|
CLI11_NODISCARD int | get_expected () const |
| | The number of times the option expects to be included.
|
| |
|
CLI11_NODISCARD int | get_expected_min () const |
| | The number of times the option expects to be included.
|
| |
|
CLI11_NODISCARD int | get_expected_max () const |
| | The max number of times the option expects to be included.
|
| |
|
CLI11_NODISCARD int | get_items_expected_min () const |
| | The total min number of expected string values to be used.
|
| |
|
CLI11_NODISCARD int | get_items_expected_max () const |
| | Get the maximum number of items expected to be returned and used for the callback.
|
| |
|
CLI11_NODISCARD int | get_items_expected () const |
| | The total min number of expected string values to be used.
|
| |
|
CLI11_NODISCARD bool | get_positional () const |
| | True if the argument can be given directly.
|
| |
|
CLI11_NODISCARD bool | nonpositional () const |
| | True if option has at least one non-positional name.
|
| |
|
CLI11_NODISCARD bool | has_description () const |
| | True if option has description.
|
| |
|
CLI11_NODISCARD const std::string & | get_description () const |
| | Get the description.
|
| |
|
Option * | description (std::string option_description) |
| | Set the description.
|
| |
|
Option * | option_text (std::string text) |
| |
|
CLI11_NODISCARD const std::string & | get_option_text () const |
| |
|
| CLI11_NODISCARD 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)
|
| |
|
|
void | run_callback () |
| | Process the callback.
|
| |
|
CLI11_NODISCARD const std::string & | matching_name (const Option &other) const |
| | If options share any of the same names, find it.
|
| |
|
bool | operator== (const Option &other) const |
| | If options share any of the same names, they are equal (not counting positional)
|
| |
|
CLI11_NODISCARD bool | check_name (const std::string &name) const |
| | Check a name. Requires "-" or "--" for short / long, supports positional name.
|
| |
|
CLI11_NODISCARD bool | check_sname (std::string name) const |
| | Requires "-" to be removed from string.
|
| |
|
CLI11_NODISCARD bool | check_lname (std::string name) const |
| | Requires "--" to be removed from string.
|
| |
|
CLI11_NODISCARD bool | check_fname (std::string name) const |
| | Requires "--" to be removed from string.
|
| |
| CLI11_NODISCARD std::string | get_flag_value (const std::string &name, std::string input_value) const |
| |
|
Option * | add_result (std::string s) |
| | Puts a result at the end.
|
| |
|
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.
|
| |
|
Option * | add_result (std::vector< std::string > s) |
| | Puts a result at the end.
|
| |
|
CLI11_NODISCARD const results_t & | results () const |
| | Get the current complete results set.
|
| |
|
CLI11_NODISCARD results_t | reduced_results () const |
| | Get a copy of the results.
|
| |
|
template<typename T > |
| void | results (T &output) const |
| | Get the results as a specified type.
|
| |
|
template<typename T > |
| CLI11_NODISCARD T | as () const |
| | Return the results as the specified type.
|
| |
|
CLI11_NODISCARD bool | get_callback_run () const |
| | See if the callback has been run already.
|
| |
|
Option * | group (const std::string &name) |
| | Changes the group membership.
|
| |
|
Option * | required (bool value=true) |
| | Set the option as required.
|
| |
|
Option * | mandatory (bool value=true) |
| | Support Plumbum term.
|
| |
|
Option * | always_capture_default (bool value=true) |
| |
|
CLI11_NODISCARD const std::string & | get_group () const |
| | Get the group of this option.
|
| |
|
CLI11_NODISCARD bool | get_required () const |
| | True if this is a required option.
|
| |
|
CLI11_NODISCARD bool | get_ignore_case () const |
| | The status of ignore case.
|
| |
|
CLI11_NODISCARD bool | get_ignore_underscore () const |
| | The status of ignore_underscore.
|
| |
|
CLI11_NODISCARD bool | get_configurable () const |
| | The status of configurable.
|
| |
|
CLI11_NODISCARD bool | get_disable_flag_override () const |
| | The status of configurable.
|
| |
|
CLI11_NODISCARD char | get_delimiter () const |
| | Get the current delimiter char.
|
| |
|
CLI11_NODISCARD bool | get_always_capture_default () const |
| | Return true if this will automatically capture the default value for help printing.
|
| |
|
CLI11_NODISCARD MultiOptionPolicy | get_multi_option_policy () const |
| | The status of the multi option policy.
|
| |
|
CLI11_NODISCARD CallbackPriority | get_callback_priority () const |
| | The priority of callback.
|
| |
|
Option * | take_last () |
| | Set the multi option policy to take last.
|
| |
|
Option * | take_first () |
| | Set the multi option policy to take last.
|
| |
|
Option * | take_all () |
| | Set the multi option policy to take all arguments.
|
| |
|
Option * | join () |
| | Set the multi option policy to join.
|
| |
|
Option * | join (char delim) |
| | Set the multi option policy to join with a specific delimiter.
|
| |
|
Option * | configurable (bool value=true) |
| | Allow in a configuration file.
|
| |
|
Option * | delimiter (char value='\0') |
| | Allow in a configuration file.
|
| |