|
kaycxx-cli
C++ CLI library
|
Positional parameters consume arguments that are not parsed as flags or options. They are converted with the same typed value conversion used by options.
A single parameter consumes exactly one value and is required unless a default is configured.
Use the returned handles to read the values. After successful parsing, every single parameter has either its parsed value or its configured default.
command::parameters<T> defines a list that can consume multiple values. It accepts zero or more values by default. min and max constrain the count.
Read the result as std::vector<T> const&.
Default lists are also configured through the handle.
Configured defaults must satisfy the same min and max limits as command-line values. Invalid default counts are reported when positional parameters are validated.
Parameters are declared in allocation order. Each repeated parameter first receives its minimum number of values, then consumes additional values while reserving the minimum required by later parameters. This supports both a repeated prefix and a repeated suffix.
Definitions with several optional or unbounded parameter lists can be inherently ambiguous. The parser still allocates values deterministically in declaration order, but the command should use shapes that have a clear meaning for its users.
Flags and options may appear before, after, or between positional arguments. Use -- when a positional value begins with - and must not be interpreted as a switch.