|
kaycxx-cli
C++ CLI library
|
Typed single positional parameter definition. More...
#include <kaycxx/cli/parameter.hpp>


Public Member Functions | |
| parameter (std::string_view name, std::optional< std::string_view > description=std::nullopt) | |
| Creates a positional parameter definition. | |
| void | default_value (T value) |
| Sets the default parameter value. | |
| std::string | usage () const override |
| Returns generated help usage for this parameter. | |
| std::size_t | min_count () const noexcept override |
| Returns the minimum number of values consumed by this parameter. | |
| std::size_t | max_count () const noexcept override |
| Returns the maximum number of values consumed by this parameter. | |
| std::any | parse_values (std::span< std::string_view const > values) const override |
| Parses this positional parameter. | |
Public Member Functions inherited from kaycxx::cli::parameter_base | |
| parameter_base (std::string_view name, std::optional< std::string_view > description=std::nullopt) | |
| Creates a positional parameter definition. | |
| virtual | ~parameter_base ()=default |
| Destroys the parameter definition. | |
| std::string const & | name () const noexcept |
| Returns the parameter name. | |
| std::optional< std::string > const & | description () const noexcept |
| Returns the parameter description. | |
Typed single positional parameter definition.
| T | Parsed parameter value type. |
|
inlineexplicit |
Creates a positional parameter definition.
| name | Placeholder name used by generated help output and parse errors. |
| description | Optional human-readable parameter description used by generated help output. |
|
inline |
Sets the default parameter value.
| value | Default value used when the parameter is not present in parsed arguments. |
|
inlineoverridevirtualnoexcept |
Returns the maximum number of values consumed by this parameter.
Implements kaycxx::cli::parameter_base.
|
inlineoverridevirtualnoexcept |
Returns the minimum number of values consumed by this parameter.
Implements kaycxx::cli::parameter_base.
|
inlineoverridevirtual |
Parses this positional parameter.
| values | Value texts to parse. |
| parse_error | When the value is syntactically invalid or no value is present and no default value is configured. |
Implements kaycxx::cli::parameter_base.
|
inlineoverridevirtual |
Returns generated help usage for this parameter.
Implements kaycxx::cli::parameter_base.