Ability to control --help
coloring using CLI args (e.g. --color
) with derive syntax
#6013
Open
2 tasks done
Labels
A-help
Area: documentation, including docs.rs, readme, examples, etc...
C-enhancement
Category: Raise on the bar on expectations
S-waiting-on-design
Status: Waiting on user-facing design to be resolved before implementing
Please complete the following tasks
Clap Version
4.4.2
Describe your use case
While clap can handle TTY and non-TTY outputs as well the environment variables co control color well, many applications also have additional CLI args for that, typically ``
Demonstrate --color has no effect on --help
When running
it prints color output, because clap does not know about my custom
--color
arg.Describe the solution you'd like
It seems parsing and printing help should not be a monolithic function call. I'd like parsing and help (without re-implementing manually) to be distinct operations, such that I could insert color logic between them:
I would also enjoy built-in
--color=always|never|auto
and--no-color
(shortcut flag for--color=never
), similarly to built-in--help
. Clap already detects TTY and env vars, so half of the work is already done. Plus, the color args are virtually ubiquitous. Though not sure how the result would be exposed for usage (--help
does not expose any result, because it does not have any).Alternatives, if applicable
No response
Additional Context
No response
The text was updated successfully, but these errors were encountered: