Skip to main content

parse

Function parse 

Source
pub fn parse(
    spec: &CommandSpec,
    argv: &[String],
) -> Result<ParsedArgs, ParseError>
Expand description

Parse argv (the words after the program name) against spec.

Grammar handled: --long, --long=value, --long value, -s, -s value, -s=value, -- (end-of-options), positionals, and nested subcommands. Boolean options take no value; value options consume the next word (or the =-suffix). Repeatable options accumulate. Defaults fill absent value options; required options/positionals are checked after parsing.