fn possible_long_flag_subcommand(&self, arg_os: &RawOsStr) -> Option<&str> {
        debug!("Parser::possible_long_flag_subcommand: arg={:?}", arg_os);
        if self.cmd.is_infer_subcommands_set() {
            let options = self
                .cmd
                .get_subcommands()
                .fold(Vec::new(), |mut options, sc| {
                    if let Some(long) = sc.get_long_flag() {
                        if RawOsStr::from_str(long).starts_with_os(arg_os) {
                            options.push(long);
                        }
                        options.extend(
                            sc.get_all_aliases()
                                .filter(|alias| RawOsStr::from_str(alias).starts_with_os(arg_os)),
                        )
                    }
                    options
                });
            if options.len() == 1 {
                return Some(options[0]);
            }

            for sc in options {
                if sc == arg_os {
                    return Some(sc);
                }
            }
        } else if let Some(sc_name) = self.cmd.find_long_subcmd(arg_os) {
            return Some(sc_name);
        }
        None
    }
// Checks if the arg matches a long flag subcommand name, or any of its aliases (if defined)
Checks if the arg matches a long flag subcommand name, or any of its aliases (if defined)
Checks if the arg matches a long flag subcommand name or any of its aliases ( if defined )
fn possible_long_flag_subcommand(&self, arg_os: &RawOsStr) -> Option<&str> {
        debug!("Parser::possible_long_flag_subcommand: arg={:?}", arg_os);
        if self.cmd.is_infer_subcommands_set() {
            let options = self
                .cmd
                .get_subcommands()
                .fold(Vec::new(), |mut options, sc| {
                    if let Some(long) = sc.get_long_flag() {
                        if RawOsStr::from_str(long).starts_with_os(arg_os) {
                            options.push(long);
                        }
                        options.extend(
                            sc.get_all_aliases()
                                .filter(|alias| RawOsStr::from_str(alias).starts_with_os(arg_os)),
                        )
                    }
                    options
                });
            if options.len() == 1 {
                return Some(options[0]);
            }
            for sc in options {
                if sc == arg_os {
                    return Some(sc);
                }
            }
        } else if let Some(sc_name) = self.cmd.find_long_subcmd(arg_os) {
            return Some(sc_name);
        }
        None
    }
fn possible_long_flag_subcommand ( & self , arg_os : & RawOsStr ) -> Option < & str > { debug ! ( " " arg_os ) ; if self . cmd . is_infer_subcommands_set ( ) { let options = self . cmd . get_subcommands ( ) . fold ( Vec :: new ( ) , | mut options , sc | { if let Some ( long ) = sc . get_long_flag ( ) { if RawOsStr :: from_str ( long ) . starts_with_os ( arg_os ) { options . push ( long ) ; } options . extend ( sc . get_all_aliases ( ) . filter ( | alias | RawOsStr :: from_str ( alias ) . starts_with_os ( arg_os ) ) , ) } options } ) ; if options . len ( ) == 1 { return Some ( options [ 0 ] ) ; } for sc in options { if sc == arg_os { return Some ( sc ) ; } } } else if let Some ( sc_name ) = self . cmd . find_long_subcmd ( arg_os ) { return Some ( sc_name ) ; } None }
Checks if the arg matches a long flag subcommand name, or any of its aliases (if defined)
Checks if the arg matches a long flag subcommand name or any of its aliases ( if defined )
&self
arg_os
&RawOsStr
&self
arg_os
&RawOsStr