Skip to main content

parse_command_args

Function parse_command_args 

Source
pub fn parse_command_args(
    raw: &str,
    schema: &[CommandArg],
    variants: &[Vec<CommandArg>],
) -> Result<CommandArgs, String>
Expand description

Parses a raw argument string, trying variants if defined.

If variants is non-empty, tries each variant in order and returns the first successful parse. If all fail, returns the error from the last variant.