Module parsers

Source
Expand description

Command line string parsing support

Functions§

get_definition_parts
Returns Vec<String> of definition option parts with two index positions.
is_definition_option
Returns boolean for the question “Is needle a definition option?”.
is_double_hyphen_option
Returns boolean for the question “Is needle a double hyphen option?”.
is_mops_option
Returns boolean for the question “Is needle a multi-option short syntax (mops) style option argument?”
parse_definitions
Returns std::collections::HashMap<String, String> with key:value mapped as option:definition.
parse_double_hyphen_args
Returns Options<Vec<String>> with Vector of arguments following a double hyphen -- command line argument idiom. Returns None if there was no double hyphen idiom present or there are no arguments following the double hyphen argument.
parse_first_arg
Returns Option<String> with the first positional argument to the executable. Returns None if the command was entered as the executable only.
parse_last_arg
Returns Option<String> with the last positional argument to the executable. Returns None if the command was entered as the executable only.
parse_mops
Returns Option<Vec<String>> that includes unique short options parsed from the command arguments, including any multi-option short syntax options. Returns None if there were no short options in the command
parse_options
Returns Vec<String> of command line option arguments in a command line string.