|
| | app (std::string_view name, app_options options=app_options{}) |
| | Creates a command-line application.
|
| |
|
| app (app const &)=delete |
| | Prevents copying applications.
|
| |
|
app & | operator= (app const &)=delete |
| | Prevents copy-assigning applications.
|
| |
| | app (app &&other) noexcept |
| | Moves a command-line application.
|
| |
|
| ~app () override=default |
| | Destroys the application and all definitions owned by it.
|
| |
| std::optional< std::string > const & | version () const noexcept |
| | Returns the configured application version.
|
| |
| std::optional< std::string > const & | author () const noexcept |
| | Returns the configured author name.
|
| |
| std::optional< std::string > const & | email () const noexcept |
| | Returns the configured author email address.
|
| |
| std::optional< std::string > const & | bugs () const noexcept |
| | Returns the configured bug-report destination.
|
| |
| std::optional< std::string > const & | copyright () const noexcept |
| | Returns the configured copyright notice.
|
| |
| std::optional< std::string > const & | license () const noexcept |
| | Returns the configured license text.
|
| |
| command_handle | command (std::string_view name, std::optional< std::string_view > description=std::nullopt) |
| | Registers a command.
|
| |
Public Member Functions inherited from kaycxx::cli::command |
|
| command (command const &)=delete |
| | Prevents copying command definitions.
|
| |
|
command & | operator= (command const &)=delete |
| | Prevents copy-assigning command definitions.
|
| |
|
virtual | ~command ()=default |
| | Destroys this command and all definitions owned by it.
|
| |
| std::string const & | name () const noexcept |
| | Returns the command name.
|
| |
| std::optional< std::string > const & | description () const noexcept |
| | Returns this command's configured description.
|
| |
| cli::flag_handle | flag (std::string_view name, std::optional< std::string_view > description=std::nullopt) |
| | Registers a flag without a short alias.
|
| |
| cli::flag_handle | flag (std::string_view name, char alias, std::optional< std::string_view > description=std::nullopt) |
| | Registers a flag with a short alias.
|
| |
| template<parseable_value T> |
| cli::option_handle< T > | option (std::string_view name, std::string_view value_name, std::optional< std::string_view > description=std::nullopt) |
| | Registers an option without a short alias.
|
| |
| template<parseable_value T> |
| cli::option_handle< T > | option (std::string_view name, char alias, std::string_view value_name, std::optional< std::string_view > description=std::nullopt) |
| | Registers an option with a short alias.
|
| |
| template<parseable_value T> |
| cli::repeatable_option_handle< T > | repeatable_option (std::string_view name, std::string_view value_name, std::optional< std::string_view > description=std::nullopt) |
| | Registers a repeatable option without a short alias.
|
| |
| template<parseable_value T> |
| cli::repeatable_option_handle< T > | repeatable_option (std::string_view name, char alias, std::string_view value_name, std::optional< std::string_view > description=std::nullopt) |
| | Registers a repeatable option with a short alias.
|
| |
| template<parseable_value T> |
| cli::parameter_handle< T > | parameter (std::string_view name, std::optional< std::string_view > description=std::nullopt) |
| | Registers a single positional parameter.
|
| |
| template<parseable_value T> |
| cli::parameters_handle< T > | parameters (std::string_view name, std::optional< std::string_view > description=std::nullopt) |
| | Registers a positional parameter list.
|
| |
| cli::args | parse (int argc, char *argv[]) const |
| | Parses command line arguments.
|
| |
| int | print_help (std::ostream &out=std::cout) const |
| | Writes generated help output.
|
| |
| int | print_version (std::ostream &out=std::cout) const |
| | Writes generated version output.
|
| |
Defines and parses a command-line application.
An application owns all registered flags, options, positional parameters and commands. Registration methods return lightweight handles to these owned definitions.
The handles remain valid as long as the application exists.