click-help-colors icon indicating copy to clipboard operation
click-help-colors copied to clipboard

Highlighting of options, choices and metavars

Open kdeldycke opened this issue 2 years ago • 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 https://github.com/janluke/cloup/issues/95, and is considered under https://github.com/janluke/cloup/issues/97.

kdeldycke avatar Oct 14 '21 17:10 kdeldycke

All the code to improve help screen coloring as in the screenshot above has been made available as a stand-alone package: click-extra.

kdeldycke avatar Nov 01 '21 15:11 kdeldycke