clap::Error to colored string #4133
Labels
A-help
Area: documentation, including docs.rs, readme, examples, etc...
C-enhancement
Category: Raise on the bar on expectations
S-blocked
Status: Blocked on something else such as an RFC or other implementation work.
Milestone
Please complete the following tasks
Clap Version
master
Describe your use case
I make a bash cli tool(https://github.com/sigoden/argc), it use clap as cli parser.
A pr(sigoden/argc#37) have been submitted for request colored help and colored error message.
So I need a way to covert clap::Error to colored string.
Describe the solution you'd like
The easiest way is to expose following two apis.
clap::error::Error::formatted
clap::builder::StyledStr::write_colored
A better way is to add a
to_color_string
function to clap::error::ErrorAlternatives, if applicable
No response
Additional Context
No response
The text was updated successfully, but these errors were encountered: