pico_args - Rust (original) (raw)
Expand description
An ultra simple CLI arguments parser.
If you think that this library doesn’t support some feature, it’s probably intentional.
- No help generation
- Only flags, options, free arguments and subcommands are supported
- No combined flags (like
-vvv
or-abc
) - Options can be separated by a space,
=
or nothing. See build features - Arguments can be in any order
- Non UTF-8 arguments are supported
§Build features
eq-separator
Allows parsing arguments separated by=
This feature adds about 1KiB to the resulting binaryshort-space-opt
Makes the space between short keys and their values optional (e.g.-w10
)
Ifeq-separator
is enabled, then it takes precedence and the ‘=’ is not included.
Ifeq-separator
is disabled, then-K=value
gives an error instead of returning"=value"
.
The optional space is only applicable for short keys because--keyvalue
would be ambiguouscombined-flags
Allows combination of flags, e.g.-abc
instead of-a -b -c
.
Ifshort-space-opt
oreq-separator
are enabled, you must parse flags after values, to prevent ambiguities.
An arguments parser.
A list of possible errors.