Allow more granular styling #5098
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.1
Describe your use case
This is a follow-up from #3234 (comment).
There are subcommands, or particular arguments sometimes that would benefit from having particular colouring to express what effect they could have. Imagine the fictional CLI
cluster-manager
which has adelete
subcommand. It would be nice to reflect that this will actually delete a cluster. Perhaps that subcommand will have a prompt to confirm whether the user wants to delete a cluster, to allow for automation the--yes
flag might be added. That--yes
flag might also want to be coloured in a particular way to signify it's a dangerous flag to use.Describe the solution you'd like
The current behaviour is when a subcommand has a style, it overrides the subcommand's. The first change would be to allow the subcommand to change its styling. Then, similarly to how a command's styling works, tune it to allow for overriding a command's style for:
Unless I am missing anything, this should allow any generated line in
--help
to also be uniquely styled:We could style
<args>...
,--something
, anddelete
uniquely.Alternatives, if applicable
No response
Additional Context
No response
The text was updated successfully, but these errors were encountered: