Skip to content

Commit

Permalink
Merge pull request #4667 from corneliusroemer/fix-4666
Browse files Browse the repository at this point in the history
fix: Add plural s to context in suggestions
  • Loading branch information
epage authored Jan 23, 2023
2 parents 401d86f + 5dcc5c9 commit 125dbe0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions src/error/format.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion tests/builder/subcommands.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down

0 comments on commit 125dbe0

Please sign in to comment.