15namespace kaycxx::cli {
97 std::
optional<std::
string> description_;
100 bool action_ =
false;
Handle for a registered option.
Definition option_handle.hpp:25
Common base class for command line switches.
Definition switch_base.hpp:22
virtual bool expects_value() const noexcept=0
Checks whether this switch expects a value.
std::optional< std::string > const & description() const noexcept
Returns the switch description.
virtual ~switch_base()=default
Destroys the switch definition.
std::optional< char > alias() const noexcept
Returns the short switch alias.
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.
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.
void mark_as_action() noexcept
Marks this switch as a mutually exclusive command action.
std::string const & name() const noexcept
Returns the long switch name.