What should Python apps do when asked to show help?

Marko Rauhamaa marko at pacujo.net
Thu Apr 28 13:31:37 EDT 2016


Irmen de Jong <irmen.NOSPAM at xs4all.nl>:

> 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

I've seen that used, but I find it annoying:

========================================================================
$ man ls
WARNING: terminal is not fully functional
-  (press RETURN)
========================================================================

========================================================================
$ git diff
WARNING: terminal is not fully functional
-  (press RETURN)
========================================================================

when run in emacs' Shell Mode.

Even Ctrl-C doesn't get me out of it. I curse to myself and run again:

========================================================================
$ git diff | cat
...
========================================================================


Marko



More information about the Python-list mailing list