What should Python apps do when asked to show help?

Grant Edwards grant.b.edwards at gmail.com
Sun May 1 12:30:03 EDT 2016


On 2016-05-01, Marko Rauhamaa <marko at pacujo.net> wrote:
> Grant Edwards <grant.b.edwards at gmail.com>:
>
>> On 2016-05-01, Chris Angelico <rosuav at gmail.com> wrote:
>>> Okay. How is an app supposed to know whether or not to use a pager?
>> Command line option.
>>
>>> How do you expect them to mindread?
>> Nope, just recognize '-p' or somesuch.
>
> In discussions like these, it would be important to draw from
> precedents. Are there commands that have such an option?

It's pretty rare.  It is assumed that Unix uses can type " | less" if
they want to view the output of a program with a pager.  That's
simpler and faster than spending time to try to figure out if and how
you tell some particular application to invoke a pager for you.

> I could only find:
>
>    mysql --pager CMD
>
> which seems sensible but nothing like an industry standard.
>
> Personally, I wouldn't bother with builtin paging.

I agree completely.  Builtin paging is pretty much pointless -- but if
you _are_ going to do, make it something that you invoke with a
command line option.

-- 
Grant




More information about the Python-list mailing list