cli11
Loading...
Searching...
No Matches
cli::option_defaults_t Class Referenceexport
module cli11

The settings newly created options inherit. More...

Inheritance diagram for cli::option_defaults_t:
cli::option_base_t

Public Member Functions

auto callback_priority (callback_priority_t value=callback_priority_t::normal) -> option_defaults_t *
 Sets the default callback priority.
auto multi_option_policy (multi_option_policy_t value=multi_option_policy_t::reject) -> option_defaults_t *
 Sets the default multi-option policy.
auto ignore_case (bool value=true) -> option_defaults_t *
 Sets whether name matching ignores case by default.
auto ignore_underscore (bool value=true) -> option_defaults_t *
 Sets whether name matching ignores underscores by default.
auto disable_flag_override (bool value=true) -> option_defaults_t *
 Sets whether flag overrides are rejected by default.
auto delimiter (char value='\0') -> option_defaults_t *
 Sets the default value delimiter.
Public Member Functions inherited from cli::option_base_t
template<typename self_t>
auto group (this self_t &self, const std::string &name) -> self_t *
 Sets the help group this option is listed under.
template<typename self_t>
auto required (this self_t &self, bool value=true) -> self_t *
 Marks the option as required.
template<typename self_t>
auto mandatory (this self_t &self, bool value=true) -> self_t *
 Marks the option as required.
template<typename self_t>
auto always_capture_default (this self_t &self, bool value=true) -> self_t *
 Captures the bound variable's value as the printed default.
auto get_group () const -> const std::string &
 Returns the help group this option is listed under.
auto get_required () const -> bool
 Reports whether the option must appear.
auto get_ignore_case () const -> bool
 Reports whether name matching ignores case.
auto get_ignore_underscore () const -> bool
 Reports whether name matching ignores underscores.
auto get_configurable () const -> bool
 Reports whether the option may be set from a configuration file.
auto get_disable_flag_override () const -> bool
 Reports whether flag overrides are rejected.
auto get_delimiter () const -> char
 Returns the character that splits a value into several.
auto get_always_capture_default () const -> bool
 Reports whether defaults are captured automatically.
auto get_multi_option_policy () const -> multi_option_policy_t
 Returns what happens to surplus values.
auto get_callback_priority () const -> callback_priority_t
 Returns when this option's callback runs.
template<typename self_t>
auto take_last (this self_t &self) -> self_t *
 Keeps only the last value given.
template<typename self_t>
auto take_first (this self_t &self) -> self_t *
 Keeps only the first value given.
template<typename self_t>
auto take_all (this self_t &self) -> self_t *
 Keeps every value given.
template<typename self_t>
auto join (this self_t &self) -> self_t *
 Joins every value given.
template<typename self_t>
auto join (this self_t &self, char delim) -> self_t *
 Joins every value given, using a specific delimiter.
template<typename self_t>
auto configurable (this self_t &self, bool value=true) -> self_t *
 Allows or forbids setting the option from a configuration file.
template<typename self_t>
auto delimiter (this self_t &self, char value='\0') -> self_t *
 Sets the character that splits a value into several.

Additional Inherited Members

Protected Member Functions inherited from cli::option_base_t
template<typename T>
auto copy_to (T *other) const -> void
 Copies every shared setting onto another option.
Protected Attributes inherited from cli::option_base_t
std::string group_ = std::string("OPTIONS")
 The help group this option is listed under.
bool required_ {false}
 Whether the option must appear.
bool ignore_case_ {false}
 Whether name matching ignores case.
bool ignore_underscore_ {false}
 Whether name matching ignores underscores.
bool configurable_ {true}
 Whether the option may be set from a configuration file.
bool disable_flag_override_ {false}
 Whether --no-flag style overrides are rejected.
char delimiter_ {'\0'}
 Character that splits a single value into several.
bool always_capture_default_ {false}
 Whether the bound value's default is captured automatically.
multi_option_policy_t multi_option_policy_ {multi_option_policy_t::reject}
 What to do with surplus values.
callback_priority_t callback_priority_ {callback_priority_t::normal}
 When this option's callback runs.

Detailed Description

The settings newly created options inherit.

Reachable through app_t::option_defaults(); changing a value here affects options added afterwards, not ones already created.

Member Function Documentation

◆ callback_priority()

auto cli::option_defaults_t::callback_priority ( callback_priority_t value = callback_priority_t::normal) -> option_defaults_t *
inline

Sets the default callback priority.

Parameters
valueWhen callbacks run.
Returns
A pointer to this object, for chaining.

◆ delimiter()

auto cli::option_defaults_t::delimiter ( char value = '\0') -> option_defaults_t *
inline

Sets the default value delimiter.

Parameters
valueThe delimiter, or '\0' for none.
Returns
A pointer to this object, for chaining.

◆ disable_flag_override()

auto cli::option_defaults_t::disable_flag_override ( bool value = true) -> option_defaults_t *
inline

Sets whether flag overrides are rejected by default.

Parameters
valueWhether to disable overrides.
Returns
A pointer to this object, for chaining.

◆ ignore_case()

auto cli::option_defaults_t::ignore_case ( bool value = true) -> option_defaults_t *
inline

Sets whether name matching ignores case by default.

Parameters
valueWhether to ignore case.
Returns
A pointer to this object, for chaining.

◆ ignore_underscore()

auto cli::option_defaults_t::ignore_underscore ( bool value = true) -> option_defaults_t *
inline

Sets whether name matching ignores underscores by default.

Parameters
valueWhether to ignore underscores.
Returns
A pointer to this object, for chaining.

◆ multi_option_policy()

auto cli::option_defaults_t::multi_option_policy ( multi_option_policy_t value = multi_option_policy_t::reject) -> option_defaults_t *
inline

Sets the default multi-option policy.

Parameters
valueWhat to do with surplus values.
Returns
A pointer to this object, for chaining.

The documentation for this class was generated from the following file:
  • /home/mccakit/desktop/repositories/cli11/src/option.cpp