diff --git a/src/error/format.rs b/src/error/format.rs index 7f2a6336be2..98d34b7ef4e 100644 --- a/src/error/format.rs +++ b/src/error/format.rs @@ -438,6 +438,9 @@ fn did_you_mean(styled: &mut StyledStr, context: &str, valid: &ContextValue) { styled.none(TAB); styled.good("note: "); styled.none(context); + if valid.len() > 1 { + styled.none("s"); + } styled.none(" "); for (i, valid) in valid.iter().enumerate() { if i != 0 { diff --git a/tests/builder/subcommands.rs b/tests/builder/subcommands.rs index b41683f84a5..68efacc986a 100644 --- a/tests/builder/subcommands.rs +++ b/tests/builder/subcommands.rs @@ -120,7 +120,7 @@ fn subcmd_did_you_mean_output_ambiguous() { static DYM_SUBCMD_AMBIGUOUS: &str = "\ error: unrecognized subcommand 'te' - note: subcommand 'test', 'temp' exist + note: subcommands 'test', 'temp' exist note: to pass 'te' as a value, use 'dym -- te' Usage: dym [COMMAND]