|
kaycxx-cli
C++ CLI library
|
Command line flag definition. More...
#include <kaycxx/cli/flag.hpp>


Public Member Functions | |
| std::string | usage () const override |
| Returns generated help usage for this flag. | |
| bool | expects_value () const noexcept override |
| Checks whether this flag expects a value. | |
| 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. | |
Command line flag definition.
A flag is a switch without a value. It is either present or absent in parsed arguments.
|
overridevirtualnoexcept |
|
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. |
|
overridevirtual |