Skip to content

Instantly share code, notes, and snippets.

View sp1ff's full-sized avatar

Michael sp1ff

View GitHub Profile
@sp1ff
sp1ff / custom-click-help.py
Last active January 7, 2018 03:09
Customize click help
""""Click, by default, will re-purpose docstrings for help messages. I don't
care for this choice: docstrings are generally authored in ReStructredText
(cf. PEP-287), but the default click implementation does no rendering for the
terminal. Furthermore, if you don't want click to wrap lines for a given
paragraph (a code snippet, e.g.) you need to add click-specific markup
for it. Finally, it doesn't offer any support for paged help (like git e.g.)
The click .. _docs:http://click.pocoo.org/6/documentation/#help-texts state
that help pages "...are currently not customizable in terms of their
layout...", but that's not true.