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

2016-05-02 Thread cs
On 02May2016 14:07, Grant Edwards wrote: On 2016-05-01, c...@zip.com.au wrote: 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. OS-X

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

2016-05-02 Thread Grant Edwards
On 2016-05-01, c...@zip.com.au wrote: >>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. > > OS-X _is_ UNIX. I spent almost all my time on this Mac in

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

2016-05-02 Thread Terry Reedy
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 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

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

2016-05-01 Thread Steven D'Aprano
On Mon, 2 May 2016 03:04 am, Grant Edwards wrote: > On 2016-05-01, 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?

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

2016-05-01 Thread cs
On 01May2016 17:04, Grant Edwards wrote: On 2016-05-01, 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

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

2016-05-01 Thread cs
On 01May2016 21:23, Chris Angelico wrote: On Sun, May 1, 2016 at 8:55 PM, Steven D'Aprano wrote: Is there an environment variable to tell the application what you consider "short", or should it read your mind? How about $LINES? If it's less than that,

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

2016-05-01 Thread cs
On 01May2016 20:55, Steven D'Aprano wrote: On Sun, 1 May 2016 05:28 pm, c...@zip.com.au wrote: On 01May2016 16:44, Chris Angelico wrote: So you expect the environment variable to say which of multiple pagers you might want, but only when you already

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

2016-05-01 Thread Ethan Furman
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~

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

2016-05-01 Thread Random832
On Sun, May 1, 2016, at 13:04, Grant Edwards wrote: > On 2016-05-01, Steven D'Aprano 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?

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

2016-05-01 Thread Gene Heskett
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

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

2016-05-01 Thread Grant Edwards
On 2016-05-01, 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

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

2016-05-01 Thread Steven D'Aprano
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

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

2016-05-01 Thread Grant Edwards
On 2016-05-01, Marko Rauhamaa wrote: > Grant Edwards : > >> On 2016-05-01, Chris Angelico 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

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

2016-05-01 Thread Marko Rauhamaa
Grant Edwards : > On 2016-05-01, Chris Angelico 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

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

2016-05-01 Thread Grant Edwards
On 2016-05-01, Chris Angelico wrote: > On Sun, May 1, 2016 at 3:24 PM, 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

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

2016-05-01 Thread Chris Angelico
On Sun, May 1, 2016 at 8:55 PM, Steven D'Aprano wrote: > On Sun, 1 May 2016 05:28 pm, c...@zip.com.au wrote: > >> On 01May2016 16:44, Chris Angelico wrote: > >>>So you expect the environment variable to say which of multiple pagers >>>you might want, but

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

2016-05-01 Thread Steven D'Aprano
On Sun, 1 May 2016 05:28 pm, c...@zip.com.au wrote: > On 01May2016 16:44, Chris Angelico wrote: >>So you expect the environment variable to say which of multiple pagers >>you might want, but only when you already want a pager. Okay. How is >>an app supposed to know whether or

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

2016-05-01 Thread Steven D'Aprano
On Sun, 1 May 2016 04:44 pm, Chris Angelico wrote: > On Sun, May 1, 2016 at 3:24 PM, 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

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

2016-05-01 Thread alister
On Sun, 01 May 2016 17:28:53 +1000, cs wrote: > On 01May2016 16:44, Chris Angelico wrote: >>On Sun, May 1, 2016 at 3:24 PM, wrote: >>> Yes, PAGER=cat would make "man" also not page, and likely almost >>> everything. >>> And yet I am unwilling to do so. Why?

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

2016-05-01 Thread cs
On 01May2016 16:44, Chris Angelico wrote: On Sun, May 1, 2016 at 3:24 PM, 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

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

2016-05-01 Thread Chris Angelico
On Sun, May 1, 2016 at 3:24 PM, 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

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

2016-04-30 Thread cs
On 30Apr2016 23:46, Random832 wrote: On Sat, Apr 30, 2016, at 22:30, Grant Edwards wrote: We don't want to use a PAGER variable to specify when we want a pager and when we don't want a pager. If we want a pager we append "| less" to the command. If we don't want a

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

2016-04-30 Thread Steven D'Aprano
On Sun, 1 May 2016 09:51 am, c...@zip.com.au wrote: > Let me recite one of my favourite rules of thumb: > > If it can't be turned off, it's not a feature. - Karl Heuer My microwave oven has a safety lock which prevents the mechanism from operating (generating microwaves) while the door is

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

2016-04-30 Thread Random832
On Sat, Apr 30, 2016, at 22:30, Grant Edwards wrote: > We don't want to use a PAGER variable to specify when we want a pager > and when we don't want a pager. If we want a pager we append "| less" > to the command. If we don't want a pager, we don't append that to the > command. Setting

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

2016-04-30 Thread Grant Edwards
On 2016-05-01, Random832 wrote: > On Sat, Apr 30, 2016, at 19:51, c...@zip.com.au wrote: >> _When_ they want a pager. > > Why would they need an environment variable at all in that case, rather > than explicitly invoking the pager by name? We don't want to use a PAGER

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

2016-04-30 Thread Random832
On Sat, Apr 30, 2016, at 19:51, c...@zip.com.au wrote: > _When_ they want a pager. Why would they need an environment variable at all in that case, rather than explicitly invoking the pager by name? To me, *not* having PAGER=cat signifies that someone *does* want a pager. That may be a crappy

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

2016-04-30 Thread cs
On 29Apr2016 11:40, Steven D'Aprano wrote: On Fri, 29 Apr 2016 07:08 am, Grant Edwards wrote: On 2016-04-28, Random832 wrote: On Thu, Apr 28, 2016, at 15:39, Grant Edwards wrote: That's fine. If you want two or three forms of documentation then

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

2016-04-30 Thread cs
On 30Apr2016 13:23, Steven D'Aprano wrote: On Sat, 30 Apr 2016 12:49 pm, Ben Finney wrote: Random832 writes: On Fri, Apr 29, 2016, at 22:27, Rustom Mody wrote: > Instead it does some ½-assed fall-between-the-stools of both That doesn't answer the

Re: manpage writing [rst, asciidoc, pod] was [Re: What should Python apps do when asked to show help?]

2016-04-30 Thread Paul Rubin
Rustom Mody writes: > At that point what I gleaned was that original makeinfo was in C > New one was rewritten in perl. The previous one was definitely written in C and I've looked at the code some. I hadn't known there was a new one. The C one was actually the second

Re: manpage writing [rst, asciidoc, pod] was [Re: What should Python apps do when asked to show help?]

2016-04-30 Thread Rustom Mody
On Saturday, April 30, 2016 at 9:36:42 AM UTC+5:30, Paul Rubin wrote: > Rustom Mody writes: > > As with all things rms, its taking him decades to realize this defeat > > [Latest makeinfo is 18 times slower than previous version!! > >

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

2016-04-29 Thread Random832
On Fri, Apr 29, 2016, at 23:23, Steven D'Aprano wrote: > Seriously, I'm thinking that a keyword argument to help might be useful: > > help(object, pager=None) I'd call it something more generic like "output". > where: > > - pager=None gives the current behaviour; > > - pager="foo" calls out

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

2016-04-29 Thread Rustom Mody
On Saturday, April 30, 2016 at 9:46:19 AM UTC+5:30, Random832 wrote: > On Sat, Apr 30, 2016, at 00:06, Ben Finney wrote: > > Steven D'Aprano writes: > > > > > So they want the PAGER environment variable to specify what pager they > > > want... > > > > > > ...so long as applications don't

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

2016-04-29 Thread Random832
On Sat, Apr 30, 2016, at 00:06, Ben Finney wrote: > Steven D'Aprano writes: > > > So they want the PAGER environment variable to specify what pager they > > want... > > > > ...so long as applications don't actually make use of that PAGER > > environment variable to determine

Re: manpage writing [rst, asciidoc, pod] was [Re: What should Python apps do when asked to show help?]

2016-04-29 Thread Paul Rubin
Rustom Mody writes: > As with all things rms, its taking him decades to realize this defeat > [Latest makeinfo is 18 times slower than previous version!! > https://lists.gnu.org/archive/html/bug-texinfo/2013-01/msg00012.html Wait, what's it written in now? > In the

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

2016-04-29 Thread Ben Finney
Steven D'Aprano writes: > So they want the PAGER environment variable to specify what pager they > want... > > ...so long as applications don't actually make use of that PAGER > environment variable to determine the pager they want to use. This at least does not baldly

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

2016-04-29 Thread Steven D'Aprano
On Sat, 30 Apr 2016 12:49 pm, Ben Finney wrote: > Random832 writes: > >> On Fri, Apr 29, 2016, at 22:27, Rustom Mody wrote: >> > Instead it does some ½-assed fall-between-the-stools of both >> >> That doesn't answer the question of why, if you (Well, Ethan, but >> you're

Re: manpage writing [rst, asciidoc, pod] was [Re: What should Python apps do when asked to show help?]

2016-04-29 Thread Rustom Mody
On Saturday, April 30, 2016 at 7:55:47 AM UTC+5:30, Ben Finney wrote: > "Martin A. Brown" writes: > > > Hello [Steven D'Aprano], > > > > >What is a good place where I can find out more about writing manpage? > > Writing them directly in GNU troff markup is easy enough >

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

2016-04-29 Thread Random832
On Fri, Apr 29, 2016, at 22:46, Rustom Mody wrote: > I dont get whats so hard to get in this: > When we need pagers we know where to get them And if you set PAGER=cat (thus "crippling your shell"), you will likewise know where to get them when you want to page the output from man or git. Why is

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

2016-04-29 Thread Rustom Mody
On Saturday, April 30, 2016 at 8:06:46 AM UTC+5:30, Random832 wrote: > On Fri, Apr 29, 2016, at 22:27, Rustom Mody wrote: > > On Saturday, April 30, 2016 at 7:47:11 AM UTC+5:30, Random832 wrote: > > > On Fri, Apr 29, 2016, at 22:09, Ethan Furman wrote: > > > > So I have to cripple my shell to get

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

2016-04-29 Thread Ben Finney
Random832 writes: > On Fri, Apr 29, 2016, at 22:27, Rustom Mody wrote: > > Instead it does some ½-assed fall-between-the-stools of both > > That doesn't answer the question of why, if you (Well, Ethan, but > you're taking the same position here) hate pagers so much

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

2016-04-29 Thread Random832
On Fri, Apr 29, 2016, at 22:27, Rustom Mody wrote: > On Saturday, April 30, 2016 at 7:47:11 AM UTC+5:30, Random832 wrote: > > On Fri, Apr 29, 2016, at 22:09, Ethan Furman wrote: > > > So I have to cripple my shell to get pydoc help to work nicely? Neat! > > > Actually, not so much. :( > > > >

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

2016-04-29 Thread Rustom Mody
On Saturday, April 30, 2016 at 7:47:11 AM UTC+5:30, Random832 wrote: > On Fri, Apr 29, 2016, at 22:09, Ethan Furman wrote: > > So I have to cripple my shell to get pydoc help to work nicely? Neat! > > Actually, not so much. :( > > If you don't want a pager with pydoc, when exactly do you want

Re: manpage writing [rst, asciidoc, pod] was [Re: What should Python apps do when asked to show help?]

2016-04-29 Thread Ben Finney
"Martin A. Brown" writes: > Hello [Steven D'Aprano], > > >What is a good place where I can find out more about writing manpage? Writing them directly in GNU troff markup is easy enough . For writing manual pages programmatically via Python

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

2016-04-29 Thread Random832
On Fri, Apr 29, 2016, at 22:09, Ethan Furman wrote: > So I have to cripple my shell to get pydoc help to work nicely? Neat! > Actually, not so much. :( If you don't want a pager with pydoc, when exactly do you want it? -- https://mail.python.org/mailman/listinfo/python-list

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

2016-04-29 Thread Ethan Furman
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 ` and

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

2016-04-29 Thread Steven D'Aprano
On Fri, 29 Apr 2016 07:53 pm, Rustom Mody wrote: > On Friday, April 29, 2016 at 3:07:09 PM UTC+5:30, Steven D'Aprano wrote: >> On Fri, 29 Apr 2016 03:00 pm, Rustom Mody wafted information-rich >> pheromones into the air, where they diffused rapidly: >> > Why replicate and cause annoyance? >> >>

Re: manpage writing [rst, asciidoc, pod] was [Re: What should Python apps do when asked to show help?]

2016-04-29 Thread Rustom Mody
On Friday, April 29, 2016 at 7:35:55 PM UTC+5:30, Ethan Furman wrote: > Wow. Thank you for that very informative post! > > -- > ~Ethan~ For emacs junkies there is also org-e-man [1] http://orgmode.org/worg/org-tutorials/org-e-man-documentation.html [2]

Re: manpage writing [rst, asciidoc, pod] was [Re: What should Python apps do when asked to show help?]

2016-04-29 Thread Ethan Furman
Wow. Thank you for that very informative post! -- ~Ethan~ -- https://mail.python.org/mailman/listinfo/python-list

manpage writing [rst, asciidoc, pod] was [Re: What should Python apps do when asked to show help?]

2016-04-29 Thread Martin A. Brown
Hello, >What is a good place where I can find out more about writing >manpage? I don't know of a single place where manpage authorship is particularly documented. This seems to be one of the common target links. In addition to introducing the breakdown of manpages by type (section) and

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

2016-04-29 Thread Rustom Mody
On Friday, April 29, 2016 at 3:07:09 PM UTC+5:30, Steven D'Aprano wrote: > On Fri, 29 Apr 2016 03:00 pm, Rustom Mody wafted information-rich pheromones > into the air, where they diffused rapidly: > > Why replicate and cause annoyance? > > If you don't want to use the functionality, don't. You

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

2016-04-29 Thread Steven D'Aprano
On Fri, 29 Apr 2016 03:00 pm, Rustom Mody wafted information-rich pheromones into the air, where they diffused rapidly: > Quite bewildered by this thread... > Are we in 2016? > [Reminds me of the bizarre claim that world has not moved on from text] (For the benefit of those of us still stuck in

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

2016-04-29 Thread Gregory Ewing
Irmen de Jong : if sys.stdout.isatty(): #use a pager to display help text else: #print all help text normally I think nowadays it's an anti-pattern for programs to do their own pagination. Very often the "terminal" is a GUI application with its own

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

2016-04-29 Thread Jussi Piitulainen
Rustom Mody writes: > On Friday, April 29, 2016 at 7:45:35 AM UTC+5:30, Paul Rubin wrote: >> Steven D'Aprano writes: >> > (1) print the help text to stdout; >> > (2) run the help text through a pager; >> >> Stdout unless the PAGER env var is set. Otherwise, I'd say still stdout >> since the

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

2016-04-28 Thread Rustom Mody
On Friday, April 29, 2016 at 7:45:35 AM UTC+5:30, Paul Rubin wrote: > Steven D'Aprano writes: > > (1) print the help text to stdout; > > (2) run the help text through a pager; > > Stdout unless the PAGER env var is set. Otherwise, I'd say still stdout > since the person can pipe it through a

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

2016-04-28 Thread Paul Rubin
Steven D'Aprano writes: > (1) print the help text to stdout; > (2) run the help text through a pager; Stdout unless the PAGER env var is set. Otherwise, I'd say still stdout since the person can pipe it through a pager if they want, but you could use the pager or be fancy

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

2016-04-28 Thread Steven D'Aprano
On Fri, 29 Apr 2016 07:08 am, Grant Edwards wrote: > On 2016-04-28, Random832 wrote: >> On Thu, Apr 28, 2016, at 15:39, Grant Edwards wrote: >>> That's fine. If you want two or three forms of documentation then you >>> prepare two or three forms of documentation. >>>

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

2016-04-28 Thread Grant Edwards
On 2016-04-28, Random832 wrote: > On Thu, Apr 28, 2016, at 15:39, Grant Edwards wrote: >> That's fine. If you want two or three forms of documentation then you >> prepare two or three forms of documentation. >> >> Adding an option to run the default 'help' output through

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

2016-04-28 Thread Cameron Simpson
On 29Apr2016 03:06, Chris Angelico wrote: On Fri, Apr 29, 2016 at 2:33 AM, Steven D'Aprano wrote: I have an application written in Python which accepts -h or --help to show help. I can: (1) print the help text to stdout; (2) run the help text through a

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

2016-04-28 Thread Random832
On Thu, Apr 28, 2016, at 15:39, Grant Edwards wrote: > That's fine. If you want two or three forms of documentation then you > prepare two or three forms of documentation. > > Adding an option to run the default 'help' output through a pager or > display it in a web browser doesn't somehow force

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

2016-04-28 Thread Grant Edwards
On 2016-04-28, Marko Rauhamaa wrote: > Grant Edwards : > >> On 2016-04-28, Random832 wrote: >>> One disadvantage is that you have to compose two forms of >>> documentation. >> >> Only if you want two forms of documentation. >>

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

2016-04-28 Thread Marko Rauhamaa
Grant Edwards : > On 2016-04-28, Random832 wrote: >> One disadvantage is that you have to compose two forms of >> documentation. > > Only if you want two forms of documentation. > > If you add an option to run the help info through a pager, I

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

2016-04-28 Thread Grant Edwards
On 2016-04-28, Random832 wrote: > > > On Thu, Apr 28, 2016, at 13:33, Grant Edwards wrote: >> As long as -? -h --help just write stuff to stdout you can add >> whatever other options you like that run pagers, start up web >> browsers, or show mp4 movies on the wall without

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

2016-04-28 Thread Dan Strohl via Python-list
. > -Original Message- > From: Python-list [mailto:python-list-bounces+d.strohl=f5@python.org] > On Behalf Of Random832 > Sent: Thursday, April 28, 2016 10:30 AM > To: python-list@python.org > Subject: Re: What should Python apps do when asked to show help? > > On Thu, Apr 2

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

2016-04-28 Thread Marko Rauhamaa
Irmen de Jong : > 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:

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

2016-04-28 Thread Random832
On Thu, Apr 28, 2016, at 13:33, Grant Edwards wrote: > As long as -? -h --help just write stuff to stdout you can add > whatever other options you like that run pagers, start up web > browsers, or show mp4 movies on the wall without annoying grouchy old > Unix users like me. ;) One

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

2016-04-28 Thread Jussi Piitulainen
Steven D'Aprano writes: > I have an application written in Python which accepts -h or --help to > show help. I can: > > (1) print the help text to stdout; > > (2) run the help text through a pager; > > (3) do something else? > > > Many command line tools simply output help to stdout (or stderr,

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

2016-04-28 Thread Dan Strohl via Python-list
if needed (or whatever). Dan > -Original Message- > From: Python-list [mailto:python-list-bounces+d.strohl=f5@python.org] > On Behalf Of Irmen de Jong > Sent: Thursday, April 28, 2016 10:08 AM > To: python-list@python.org > Subject: Re: What should Python apps do when asked to

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

2016-04-28 Thread Grant Edwards
On 2016-04-28, Steven D'Aprano wrote: > I have an application written in Python which accepts -h or --help to show > help. I can: > > (1) print the help text to stdout; Yep: just write it to stdout. > (2) run the help text through a pager; If you do (1), and I can do that

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

2016-04-28 Thread Random832
On Thu, Apr 28, 2016, at 13:06, Chris Angelico wrote: > On Fri, Apr 29, 2016 at 2:33 AM, Steven D'Aprano > wrote: > > Many command line tools simply output help to stdout (or stderr, if they're > > evil), > > I'm not sure stderr is particularly more evil than stdout, but

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

2016-04-28 Thread Ethan Furman
On 04/28/2016 10:02 AM, Dan Strohl via Python-list wrote: I would suggest using argparse https://docs.python.org/3/library/argparse.html as it handles all of that natively... On the other hand, if you feel that argparse is akin to using a canon to kill a mosquito, you can try scription*:

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

2016-04-28 Thread Dan Strohl via Python-list
From: John Wong [mailto:gokoproj...@gmail.com] Sent: Thursday, April 28, 2016 10:06 AM To: Dan Strohl <d.str...@f5.com> Cc: alister <alister.w...@ntlworld.com>; python-list@python.org Subject: Re: What should Python apps do when asked to show help? On Thu, Apr 28, 2016 at 1:02 PM, Da

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

2016-04-28 Thread John Wong
On Thu, Apr 28, 2016 at 1:02 PM, Dan Strohl via Python-list < python-list@python.org> wrote: > I would suggest using argparse > https://docs.python.org/3/library/argparse.html as it handles all of that > natively... including validating arguments, showing errors, help, etc... > however, assuming

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

2016-04-28 Thread Chris Angelico
On Fri, Apr 29, 2016 at 2:33 AM, Steven D'Aprano wrote: > I have an application written in Python which accepts -h or --help to show > help. I can: > > (1) print the help text to stdout; > > (2) run the help text through a pager; > > (3) do something else? > > > Many command

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

2016-04-28 Thread Irmen de Jong
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

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

2016-04-28 Thread Dan Strohl via Python-list
tion about that specific argument. > -Original Message- > From: Python-list [mailto:python-list-bounces+d.strohl=f5@python.org] > On Behalf Of alister > Sent: Thursday, April 28, 2016 9:45 AM > To: python-list@python.org > Subject: Re: What should Python apps do when asked to sh

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

2016-04-28 Thread Ethan Furman
On 04/28/2016 09:33 AM, Steven D'Aprano wrote: I have an application written in Python which accepts -h or --help to show help. I can: (1) print the help text to stdout; (2) run the help text through a pager; (3) do something else? I think if the user is proficient enough to: a) run the

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

2016-04-28 Thread alister
On Fri, 29 Apr 2016 02:33:56 +1000, Steven D'Aprano wrote: > I have an application written in Python which accepts -h or --help to > show help. I can: > > (1) print the help text to stdout; > > (2) run the help text through a pager; > > (3) do something else? > > > Many command line tools