-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Allow templates to change the error message strings #2196
Comments
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, seeclap/src/parse/errors.rs
Line 401 in 97b4fb6
Allow the user to change the colors, currently hard-coded, see
clap/src/output/fmt.rs
Line 53 in 97b4fb6
You could create a
StyleSetting
struct and a mechanism similar toAppSettings
.Additional context
Similar to #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.
The text was updated successfully, but these errors were encountered: