Click is Armin Ronacher's very cool command-line building library that make short work of building your own CLI in Python. It's really worth checking out: http://click.pocoo.org/
One of click's excellent features is the built-in help mechanism.
mycli --help basically comes for free, as well as individual command help:
mycli mycommand --help.
A common usage pattern these days, however, is to have a
help command that shows the overall help for the application. Click give you the --help option mentioned above, but your users might expect
mycli help to work instead.
Say you've defined your cli as a group:
"""My very cool command-line tool"""
And various commands that look like this:
Getting a help command to work is as simple as calling get_help on the parent context of the help command context:
That's all there is to it!