pub(crate) fn did_you_mean_flag<I, T>(
    arg: &str,
    longs: I,
    subcommands: &mut [App],
) -> Option<(String, Option<String>)>
where
    T: AsRef<str>,
    I: IntoIterator<Item = T>,
{
    match did_you_mean(arg, longs).pop() {
        Some(ref candidate) => {
            return Some((candidate.to_owned(), None));
        }
        None => {
            for subcommand in subcommands {
                subcommand._build();
                if let Some(ref candidate) = did_you_mean(
                    arg,
                    longs!(subcommand).map(|x| x.to_string_lossy().into_owned()),
                )
                .pop()
                {
                    return Some((candidate.to_owned(), Some(subcommand.get_name().to_owned())));
                }
            }
        }
    }

    None
}
/// Returns a suffix that can be empty, or is the standard 'did you mean' phrase
Returns a suffix that can be empty, or is the standard 'did you mean' phrase
Returns a suffix that can be empty or is the standard ' did you mean ' phrase
pub(crate) fn did_you_mean_flag<I, T>(
    arg: &str,
    longs: I,
    subcommands: &mut [App],
) -> Option<(String, Option<String>)>
where
    T: AsRef<str>,
    I: IntoIterator<Item = T>,
{
    match did_you_mean(arg, longs).pop() {
        Some(ref candidate) => {
            return Some((candidate.to_owned(), None));
        }
        None => {
            for subcommand in subcommands {
                subcommand._build();
                if let Some(ref candidate) = did_you_mean(
                    arg,
                    longs!(subcommand).map(|x| x.to_string_lossy().into_owned()),
                )
                .pop()
                {
                    return Some((candidate.to_owned(), Some(subcommand.get_name().to_owned())));
                }
            }
        }
    }
    None
}
pub ( crate ) fn did_you_mean_flag < I , T > ( arg : & str , longs : I , subcommands : & mut [ App ] , ) -> Option < ( String , Option < String > ) > where T : AsRef < str > , I : IntoIterator < Item = T > , { match did_you_mean ( arg , longs ) . pop ( ) { Some ( ref candidate ) => { return Some ( ( candidate . to_owned ( ) , None ) ) ; } None => { for subcommand in subcommands { subcommand . _build ( ) ; if let Some ( ref candidate ) = did_you_mean ( arg , longs ! ( subcommand ) . map ( | x | x . to_string_lossy ( ) . into_owned ( ) ) , ) . pop ( ) { return Some ( ( candidate . to_owned ( ) , Some ( subcommand . get_name ( ) . to_owned ( ) ) ) ) ; } } } } None }
Returns a suffix that can be empty, or is the standard 'did you mean' phrase
Returns a suffix that can be empty or is the standard ' did you mean ' phrase
arg
&str
longs
I
subcommands
&mut [App]
arg
&str
longs
I
subcommands
&mut [App]