parse_optional_arg

Function parse_optional_arg 

Source
pub fn parse_optional_arg<T>(
    args: &[String],
    index: usize,
    name: &'static str,
) -> Result<Option<T>, CommandParseError>
where T: FromStr,
Expand description

Parse an optional argument at the given index. Returns Ok(None) if the argument is missing. Returns Ok(Some(value)) if present and parseable. Returns Err if present but invalid.