What should Python apps do when asked to show help?

Ethan Furman ethan at stoneleaf.us
Fri Apr 29 22:09:13 EDT 2016


On 04/29/2016 06:20 PM, Steven D'Aprano wrote:
> On Fri, 29 Apr 2016 07:53 pm, Rustom Mody wrote:


>> JFTR I find git behavior annoying -- as it seems do others
>
> `git --help` behaves as the Unix standard: it prints help output to stdout.
> Is that the annoying behaviour?

No.

> `git help <command>` and `git <command> --help` call `man`. Is that the
> annoying behaviour?

Yes.

> Then presumably `man` is also annoying,

No.

> and the advise I was given to just  use man pages is bad advice.

The advice to call man from --help is bad; the advice to have a man page 
for use with man is not.

>> With python's help I find it annoying and Ive not figured out how to not
>> get paging
>
> o_O
>
> Okay, now I'm feeling as if you had said "I find it annoying to be fit and
> healthy, I've not found a way to feel sufficiently sick, tired and
> out-of-shape all the time."

And exactly what is healthy and fit about calling "help(something)" and 
then having that help disappear?  I find that *extremely* annoying.

> But I see your point. The pydoc documentation itself is lacking. But from
> reading the source code, I see that if you set the PAGER environment
> variable to your preferred pager, it will use that. So setting it to "cat"
> should work. I've just tested this under Linux, and it works for me:

So I have to cripple my shell to get pydoc help to work nicely?  Neat! 
Actually, not so much.  :(

--
~Ethan~



More information about the Python-list mailing list