flag_with_default_parser

Function flag_with_default_parser 

Source
fn flag_with_default_parser<S, T>(
    short_cmd: Option<char>,
    long_cmd: &'static str,
    argument_help: &'static str,
    help: &'static str,
    default: T,
    transform: fn(S) -> T,
) -> impl Parser<Option<T>>
where S: FromStr + 'static, <S as FromStr>::Err: Display, T: Clone + 'static,
Expand description

This is a helper function that fulfills the following parsing task check for long/short cmd. If there is the flag with this If the flag is not there, parse None`` If the flag is there but no argument, parse Some(default)` If the flag is there and an argument parse the arugment