|
kaycxx-cli
C++ CLI library
|
Common base class for typed options. More...
#include <kaycxx/cli/option.hpp>


Public Member Functions | |
| virtual std::string const & | value_name () const noexcept=0 |
| Returns the value placeholder name. | |
| virtual std::optional< std::any > | default_value () const =0 |
| Returns the configured default value. | |
| bool | is_repeatable () const noexcept |
| Checks whether this option accepts multiple occurrences. | |
| switch_base (std::string_view name, std::optional< std::string_view > description=std::nullopt) | |
| Creates a switch without a short alias. | |
| switch_base (std::string_view name, char alias, std::optional< std::string_view > description=std::nullopt) | |
| Creates a switch with a short alias. | |
Public Member Functions inherited from kaycxx::cli::switch_base | |
| switch_base (std::string_view name, std::optional< std::string_view > description=std::nullopt) | |
| Creates a switch without a short alias. | |
| switch_base (std::string_view name, char alias, std::optional< std::string_view > description=std::nullopt) | |
| Creates a switch with a short alias. | |
| virtual | ~switch_base ()=default |
| Destroys the switch definition. | |
| std::string const & | name () const noexcept |
| Returns the long switch name. | |
| std::optional< char > | alias () const noexcept |
| Returns the short switch alias. | |
| std::optional< std::string > const & | description () const noexcept |
| Returns the switch description. | |
| void | mark_as_action () noexcept |
| Marks this switch as a mutually exclusive command action. | |
| bool | is_action () const noexcept |
| Checks whether this switch is a command action. | |
| virtual std::string | usage () const =0 |
| Returns generated help usage for this switch. | |
| virtual bool | expects_value () const noexcept=0 |
| Checks whether this switch expects a value. | |
Friends | |
| class | command |
Common base class for typed options.
|
pure virtual |
Returns the configured default value.
Implemented in kaycxx::cli::option< T >.
|
inlinenoexcept |
Checks whether this option accepts multiple occurrences.
|
explicit |
Creates a switch with a short alias.
| name | Long switch name without the leading --. |
| alias | Short switch alias without the leading -. |
| description | Optional human-readable description used by generated help output. |
|
explicit |
Creates a switch without a short alias.
| name | Long switch name without the leading --. |
| description | Optional human-readable description used by generated help output. |
Returns the value placeholder name.
Implemented in kaycxx::cli::option< T >.