Skip to content

Commit

Permalink
fix(error): Don't highlight 'similar'
Browse files Browse the repository at this point in the history
  • Loading branch information
epage committed Mar 28, 2023
1 parent 8f45d2f commit f58ae17
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions clap_builder/src/error/format.rs
Expand Up @@ -427,21 +427,21 @@ fn try_help(styled: &mut StyledStr, help: Option<&str>) {

#[cfg(feature = "error-context")]
fn did_you_mean(styled: &mut StyledStr, context: &str, valid: &ContextValue) {
styled.none(TAB);
styled.good("tip:");
if let ContextValue::String(valid) = valid {
styled.none(TAB);
styled.good("tip: a similar ");
styled.none(" a similar ");
styled.none(context);
styled.none(" exists: '");
styled.good(valid);
styled.none("'");
} else if let ContextValue::Strings(valid) = valid {
styled.none(TAB);
if valid.len() == 1 {
styled.good("tip: a similar ");
styled.none(" a similar ");
styled.none(context);
styled.none(" exists: ");
} else {
styled.good("tip: some similar ");
styled.none(" some similar ");
styled.none(context);
styled.none("s exist: ");
}
Expand Down

0 comments on commit f58ae17

Please sign in to comment.