What should Python apps do when asked to show help?

Irmen de Jong irmen.NOSPAM at xs4all.nl
Thu Apr 28 13:08:14 EDT 2016


On 28-4-2016 18:33, Steven D'Aprano wrote:


> but I was thinking of doing both: give my application a subcommand or an
> option to display help directly in a pager, while -h and --help print to
> stdout as normal.
> 
> What do you think? Too clever?

An idea: Use just one help option, then

if sys.stdout.isatty():
    #....use a pager to display help text
else:
    #....print all help text normally


Irmen




More information about the Python-list mailing list