|
cli11
|
The option type: one command-line option and everything set on it. More...
#include <cerrno>import cli11:validators;import std;Classes | |
| class | cli::option_base_t |
| Settings shared by option_t and option_defaults_t. More... | |
| class | cli::option_defaults_t |
| The settings newly created options inherit. More... | |
| class | cli::option_t |
| One command-line option, flag, or positional argument. More... | |
Typedefs | |
| using | cli::results_t = std::vector<std::string> |
| The raw strings collected for one option. | |
| using | cli::callback_t = std::function<bool(const results_t &)> |
| The callback that turns collected results into a bound value. | |
| using | cli::option_ptr_t = std::unique_ptr<option_t> |
| Owning handle to an option. | |
| using | cli::validator_ptr_t = std::shared_ptr<validator_t> |
| Shared handle to a validator. | |
Enumerations | |
| enum class | cli::multi_option_policy_t : std::uint8_t { reject , take_last , take_first , join , take_all , sum , reverse } |
| What to do when an option is given more values than it expects. More... | |
| enum class | cli::callback_priority_t : std::uint8_t { first_pre_help = 0 , first = 1 , pre_requirements_check_pre_help = 2 , pre_requirements_check = 3 , normal_pre_help = 4 , normal = 5 , last_pre_help = 6 , last = 7 } |
| When an option's callback runs relative to the others. More... | |
The option type: one command-line option and everything set on it.
An cli::option_t is created by app_t::add_option and configured by chaining: app.add_option("--f,--file", path)->required()->check(cli::existing_file). Settings shared with app_t's option defaults live in cli::option_base_t.
An option moves through cli::option_t::option_state_t as parsing proceeds: raw results are collected, validated, reduced according to the multi-option policy, and finally handed to the callback that writes the bound variable.
|
exportstrong |
When an option's callback runs relative to the others.
|
exportstrong |
What to do when an option is given more values than it expects.