Closed filipelbc closed 2 years ago
Note: Same as #1433 but this issue needs error message template support.
Might also be related to #1734
This request seems most like #1790 which we closed because we are not looking at allowing granular styling of claps API, instead favoring templates and #1433. Since we have #1734 for an error message template and #1433 for styling it, I'm going to go ahead and close this out.
If there is any concern with this plan, let us know!
Before anything, this library is great! Thanks!
Make sure you completed the following tasks
Describe your use case
I prefer printing
ERROR: ...
instead oferror: ...
, and to make the background red, instead of the foreground.Describe the solution you'd like
Allow the user to set the
"error: "
string, which is currently hard-coded, see https://github.com/clap-rs/clap/blob/97b4fb639f846c5b910c318dd6c6f7d6da779d7d/src/parse/errors.rs#L401Allow the user to change the colors, currently hard-coded, see https://github.com/clap-rs/clap/blob/97b4fb639f846c5b910c318dd6c6f7d6da779d7d/src/output/fmt.rs#L53
You could create a
StyleSetting
struct and a mechanism similar toAppSettings
.Additional context
Similar to https://github.com/clap-rs/clap/issues/2035, but instead of allowing usage of Clap's error formatting, allow the user to customize Clap's messages and style to fit his preferences.