Skip to main content

Module args

Module args 

Source
Expand description

§Argument parser

Parses and generates configuration from supplied arguments and option specifications Can also generate usage strings

Structs§

Config
Specifies a configuration of parsed arguments Each option which was given as a spec can be accessed by option(name) This returns a Option<Vec> containing the values of the option (if any)
OptionSpec
Specifies an option that can be given in the command line
Later supplied to config::Config::new()
abrev: The abreviation of name, e.g; ‘r’ or ‘c’ name: The name/trigger for the option, e.g; “recursive” or “clean”, an a name of “(unnamed)” specifies the first unnamed arguments before any option is given
desc: a short description printed with –help
required: specifies if the option is required or optional
policy: an enum containing the number of values and how they’re enforced

Enums§

OptionPolicy
Determines how the number of supplied values should match an argument 0 val indicates a switch like argument