click-contrib/click-help-colors

Highlighting of options, choices and metavars

Opened this issue · 1 comments

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:

cli-colored-help

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 janluke/cloup#95, and is considered under janluke/cloup#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.