Skip to main content

parse

Function parse 

Source
pub fn parse(
    args: &[&str],
    arguments: &[Argument],
    required_groups: &[usize],
) -> Result<Parsed, String>
Expand description

Parses args as ArgumentParser.parse_args does, for the declared arguments; required_groups are the mutually exclusive groups with required=True. Err holds the message of parser.error.

Parsing stops at -h or a version action: the result then has the argument (see Parsed::flag), as argparse prints and exits there.