Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Add plural s to context in suggestions #4667

Merged
merged 1 commit into from Jan 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/error/format.rs
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");
}
epage marked this conversation as resolved.
Show resolved Hide resolved
styled.none(" ");
for (i, valid) in valid.iter().enumerate() {
if i != 0 {
Expand Down
2 changes: 1 addition & 1 deletion tests/builder/subcommands.rs
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
epage marked this conversation as resolved.
Show resolved Hide resolved
note: to pass 'te' as a value, use 'dym -- te'

Usage: dym [COMMAND]
Expand Down