4.6.0
Freundlich's C++ toolkit
|
An argument parser.
Argument parsers match the next command-line parameter that is not a flag ("-f"/"--flag") or an option ("-o value"/"--option value""). The result is stored in a record that has a single element with label Label and type Type. In case reading the value into Type fails, the parser also fails.
Label | An fcppt::record::label. |
Type | The type of the argument's value which must be readable from an fcppt::io::istream. |
Public Types | |
using | element_type = fcppt::record::element<Label, Type> |
using | result_type = fcppt::record::object<element_type> |
Public Member Functions | |
argument (fcppt::options::long_name &&long_name, fcppt::options::optional_help_text &&help_text) | |
Constructs an argument parser. | |
fcppt::options::parse_result< result_type > | parse (fcppt::options::state &&, fcppt::options::parse_context const &) const |
fcppt::options::flag_name_set | flag_names () const |
fcppt::options::option_name_set | option_names () const |
fcppt::options::usage | usage () const |
using fcppt::options::argument< Label, Type >::element_type = fcppt::record::element<Label, Type> |
using fcppt::options::argument< Label, Type >::result_type = fcppt::record::object<element_type> |
fcppt::options::argument< Label, Type >::argument | ( | fcppt::options::long_name && | long_name, |
fcppt::options::optional_help_text && | help_text ) |
Constructs an argument parser.
long_name | The name of the argument as displayed in usage output. |
help_text | Optional help text for this argument. |
|
nodiscard |
|
nodiscard |
|
nodiscard |
|
nodiscard |