click-help-colors
click-help-colors copied to clipboard
Highlighting of options, choices and metavars
I developed some code in my mail-deduplicate
CLI some month ago to automatically highlights all options, choices and metavars in help screens generated by click. See how it renders:
For reference, here is my current implementation, which is mainly based on regular expressions.
To me it is a good enough compromise, because help screen are not consumed by machine but are designed for human. Is this workaround good enough to be adapted to click-help-colors
or serve as inspiration?
For the record, this has initially been discussed for Cloup at https://github.com/janluke/cloup/issues/95, and is considered under https://github.com/janluke/cloup/issues/97.
All the code to improve help screen coloring as in the screenshot above has been made available as a stand-alone package: click-extra
.