Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #107941 > unrolled thread

Re: What should Python apps do when asked to show help?

Started byGrant Edwards <grant.b.edwards@gmail.com>
First post2016-05-01 13:53 +0000
Last post2016-05-01 10:54 -0700
Articles 10 — 7 participants

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: What should Python apps do when asked to show help? Grant Edwards <grant.b.edwards@gmail.com> - 2016-05-01 13:53 +0000
    Re: What should Python apps do when asked to show help? Marko Rauhamaa <marko@pacujo.net> - 2016-05-01 18:08 +0300
      Re: What should Python apps do when asked to show help? Grant Edwards <grant.b.edwards@gmail.com> - 2016-05-01 16:30 +0000
        Re: What should Python apps do when asked to show help? Steven D'Aprano <steve@pearwood.info> - 2016-05-02 02:36 +1000
          Re: What should Python apps do when asked to show help? Grant Edwards <grant.b.edwards@gmail.com> - 2016-05-01 17:04 +0000
            Re: What should Python apps do when asked to show help? Steven D'Aprano <steve@pearwood.info> - 2016-05-02 11:48 +1000
              Re: What should Python apps do when asked to show help? Terry Reedy <tjreedy@udel.edu> - 2016-05-02 02:34 -0400
          Re: What should Python apps do when asked to show help? Gene Heskett <gheskett@wdtv.com> - 2016-05-01 13:09 -0400
          Re: What should Python apps do when asked to show help? Random832 <random832@fastmail.com> - 2016-05-01 13:49 -0400
          Re: What should Python apps do when asked to show help? Ethan Furman <ethan@stoneleaf.us> - 2016-05-01 10:54 -0700

#107941 — Re: What should Python apps do when asked to show help?

FromGrant Edwards <grant.b.edwards@gmail.com>
Date2016-05-01 13:53 +0000
SubjectRe: What should Python apps do when asked to show help?
Message-ID<mailman.283.1462110832.32212.python-list@python.org>
On 2016-05-01, Chris Angelico <rosuav@gmail.com> wrote:
> On Sun, May 1, 2016 at 3:24 PM,  <cs@zip.com.au> wrote:
>> Yes, PAGER=cat would make "man" also not page, and likely almost everything.
>> And yet I am unwilling to do so. Why?
>>
>> On reflection, my personal problems with this approach are twofold:
>>
>> - I want $PAGER to specify my preferred pager when I do want a pager, so
>> setting it to "cat" does not inform apps about my wishes
>
> So you expect the environment variable to say which of multiple pagers
> you might want, but only when you already want a pager.

Yes!

Just like EDITOR specifies which editor to use _when_ _you_ _want_
_to_ _use_ _an_ _editor_.  It doesn't tell programs to invoke an
editor all the time.

> 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.

-- 
Grant

[toc] | [next] | [standalone]


#107943

FromMarko Rauhamaa <marko@pacujo.net>
Date2016-05-01 18:08 +0300
Message-ID<87r3dlolx6.fsf@elektro.pacujo.net>
In reply to#107941
Grant Edwards <grant.b.edwards@gmail.com>:

> On 2016-05-01, Chris Angelico <rosuav@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?

I could only find:

   mysql --pager CMD

which seems sensible but nothing like an industry standard.

Personally, I wouldn't bother with builtin paging.


Marko

[toc] | [prev] | [next] | [standalone]


#107944

FromGrant Edwards <grant.b.edwards@gmail.com>
Date2016-05-01 16:30 +0000
Message-ID<mailman.284.1462120216.32212.python-list@python.org>
In reply to#107943
On 2016-05-01, Marko Rauhamaa <marko@pacujo.net> wrote:
> Grant Edwards <grant.b.edwards@gmail.com>:
>
>> On 2016-05-01, Chris Angelico <rosuav@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

[toc] | [prev] | [next] | [standalone]


#107945

FromSteven D'Aprano <steve@pearwood.info>
Date2016-05-02 02:36 +1000
Message-ID<572630a1$0$1595$c3e8da3$5496439d@news.astraweb.com>
In reply to#107944
On Mon, 2 May 2016 02:30 am, Grant Edwards wrote:

>> 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" 


Is nobody except me questioning the assumption that we're only talking about
Unix users?



-- 
Steven

[toc] | [prev] | [next] | [standalone]


#107947

FromGrant Edwards <grant.b.edwards@gmail.com>
Date2016-05-01 17:04 +0000
Message-ID<mailman.286.1462122256.32212.python-list@python.org>
In reply to#107945
On 2016-05-01, Steven D'Aprano <steve@pearwood.info> wrote:
> On Mon, 2 May 2016 02:30 am, Grant Edwards wrote:
>
>>> 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" 
>
> Is nobody except me questioning the assumption that we're only
> talking about Unix users?

Didn't the OP specify that he was writing a command-line utility for
Linux/Unix?

Discussing command line operation for Windows or OS-X seems rather
pointless.

-- 
Grant



[toc] | [prev] | [next] | [standalone]


#107961

FromSteven D'Aprano <steve@pearwood.info>
Date2016-05-02 11:48 +1000
Message-ID<5726b1f3$0$1603$c3e8da3$5496439d@news.astraweb.com>
In reply to#107947
On Mon, 2 May 2016 03:04 am, Grant Edwards wrote:

> On 2016-05-01, Steven D'Aprano <steve@pearwood.info> wrote:
>> On Mon, 2 May 2016 02:30 am, Grant Edwards wrote:
>>
>>>> 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"
>>
>> Is nobody except me questioning the assumption that we're only
>> talking about Unix users?
> 
> Didn't the OP specify that he was writing a command-line utility for
> Linux/Unix?

*cough* I'm the OP, and no I didn't.

Obviously I'm a Linux user myself, but I'm presumptuous enough to hope that
when I release the utility publicly[1], others may find it of some small
use. Including Windows users.




[1] Real Soon Now.


-- 
Steven

[toc] | [prev] | [next] | [standalone]


#107994

FromTerry Reedy <tjreedy@udel.edu>
Date2016-05-02 02:34 -0400
Message-ID<mailman.309.1462170863.32212.python-list@python.org>
In reply to#107961
On 5/1/2016 9:48 PM, Steven D'Aprano wrote:
> On Mon, 2 May 2016 03:04 am, Grant Edwards wrote:
>
>> On 2016-05-01, Steven D'Aprano <steve@pearwood.info> wrote:
>>> On Mon, 2 May 2016 02:30 am, Grant Edwards wrote:
>>>
>>>>> 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"
>>>
>>> Is nobody except me questioning the assumption that we're only
>>> talking about Unix users?
>>
>> Didn't the OP specify that he was writing a command-line utility for
>> Linux/Unix?
>
> *cough* I'm the OP, and no I didn't.
>
> Obviously I'm a Linux user myself, but I'm presumptuous enough to hope that
> when I release the utility publicly[1], others may find it of some small
> use. Including Windows users.
>
> [1] Real Soon Now.

As a Windows user in recent years, I expect -h to give me a list of 
options, hopefully with some annotation beyond the bare bones, that give 
the signature of the command (regarding it as a function call).  'python 
-h' is pretty bare bones.  'python -m test -h' is much better.  I expect 
both to tell me how to properly pass a file argument.  I don't expect 
either to tell me how write a python or unittest file.  I use the manual 
for this.

-- 
Terry Jan Reedy

[toc] | [prev] | [next] | [standalone]


#107948

FromGene Heskett <gheskett@wdtv.com>
Date2016-05-01 13:09 -0400
Message-ID<mailman.287.1462123030.32212.python-list@python.org>
In reply to#107945
On Sunday 01 May 2016 12:36:48 Steven D'Aprano wrote:

> On Mon, 2 May 2016 02:30 am, Grant Edwards wrote:
> >> 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"
>
> Is nobody except me questioning the assumption that we're only talking
> about Unix users?
>
linux, unix, mauche nichs.  Are there others?>
>
> --
> Steven


Cheers, Gene Heskett
-- 
"There are four boxes to be used in defense of liberty:
 soap, ballot, jury, and ammo. Please use in that order."
-Ed Howdershelt (Author)
Genes Web page <http://geneslinuxbox.net:6309/gene>

[toc] | [prev] | [next] | [standalone]


#107949

FromRandom832 <random832@fastmail.com>
Date2016-05-01 13:49 -0400
Message-ID<mailman.288.1462124965.32212.python-list@python.org>
In reply to#107945
On Sun, May 1, 2016, at 13:04, Grant Edwards wrote:
> On 2016-05-01, Steven D'Aprano <steve@pearwood.info> wrote:
> > Is nobody except me questioning the assumption that we're only
> > talking about Unix users?
> 
> Didn't the OP specify that he was writing a command-line utility for
> Linux/Unix?

We've been talking about pydoc instead of the OP's program for a while
now.

[toc] | [prev] | [next] | [standalone]


#107950

FromEthan Furman <ethan@stoneleaf.us>
Date2016-05-01 10:54 -0700
Message-ID<mailman.289.1462125603.32212.python-list@python.org>
In reply to#107945
On 05/01/2016 09:36 AM, Steven D'Aprano wrote:
> On Mon, 2 May 2016 02:30 am, Grant Edwards wrote:

>> It's pretty rare.  It is assumed that Unix uses can type " | less"
>
> Is nobody except me questioning the assumption that we're only talking about
> Unix users?

Even Windows has "more".

--
~Ethan~

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web