diff --git a/CHANGELOG.md b/CHANGELOG.md index c6e02a0f34d..c78ca25abf8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/). ## [Unreleased] - ReleaseDate +### Fixes + +- Don't highlight uninteresting parts of the error message + ## [4.2.0] - 2023-03-28 ### Compatibility diff --git a/clap_builder/src/error/format.rs b/clap_builder/src/error/format.rs index 9f11846b1f7..5ada0abe566 100644 --- a/clap_builder/src/error/format.rs +++ b/clap_builder/src/error/format.rs @@ -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: "); }