[issue14102] argparse: add ability to create a man page

2018-06-15 Thread Pavel Raiskup
Pavel Raiskup added the comment: On Friday, June 15, 2018 11:54:04 AM CEST Daniel Walsh wrote: > Correct, the reason I would want this is to add something to a Makefile > ... > manpages: foo.py > ./python foo.py --manpage > foo.1 The /bin/argparse-manpage could help temporarily (if you

[issue14102] argparse: add ability to create a man page

2018-06-15 Thread Oz Tiram
Oz Tiram added the comment: As already pointed out, it can get the parser somehow, you don't need an explicit extra option --man. That's the approach suggesed in: man-argparse and build_manpage.py attached here You can use it a make file like this: install: ./setup.py build_manpage

[issue14102] argparse: add ability to create a man page

2018-06-15 Thread Daniel Walsh
Daniel Walsh added the comment: On 06/14/2018 07:15 PM, Ben Finney wrote: > Ben Finney added the comment: > > On Thu, 2018-06-14 20:02 +, Pablo Galindo Salgado > wrote: >> The (possible) confusion is the existence of a manpage only available >> though argparse (`./python foo.py

[issue14102] argparse: add ability to create a man page

2018-06-14 Thread Pavel Raiskup
Pavel Raiskup added the comment: On Friday, June 15, 2018 1:52:41 AM CEST Ben Finney wrote: > On Thu, 2018-06-14 23:46 +, Aaron Meurer wrote: > > Couldn't such a tool exist outside the standard library. > > I've tried writing such a tool. It would ideally re-use as much as feasible of >

[issue14102] argparse: add ability to create a man page

2018-06-14 Thread Aaron Meurer
Aaron Meurer added the comment: I see. I haven't dug much into the argoarse source, so I don't have a good feel for how feasible such a tool would be to write. Such refactoring would also be useful for generating HTML or RST for the help. I've previously used help2man and man2html to

[issue14102] argparse: add ability to create a man page

2018-06-14 Thread Ben Finney
Ben Finney added the comment: On Thu, 2018-06-14 23:46 +, Aaron Meurer wrote: > Couldn't such a tool exist outside the standard library. I've tried writing such a tool. It would ideally re-use as much as feasible of the functionality that assembles the usage message. But that is

[issue14102] argparse: add ability to create a man page

2018-06-14 Thread Aaron Meurer
Aaron Meurer added the comment: Couldn't such a tool exist outside the standard library. I'm thinking a function that you would import and wrap the parser object, similar to how argcomplete works (https://argcomplete.readthedocs.io/en/latest/index.html). The downside is that developers

[issue14102] argparse: add ability to create a man page

2018-06-14 Thread Éric Araujo
Éric Araujo added the comment: Thanks Ben for expressing exactly what this ticket is about and why the code would be in argparse. (The author of argparse and Raymond a senior core dev also agree that adding a man page formatter to argparse would be useful.) --

[issue14102] argparse: add ability to create a man page

2018-06-14 Thread Ben Finney
Ben Finney added the comment: On Thu, 2018-06-14 20:02 +, Pablo Galindo Salgado wrote: > The (possible) confusion is the existence of a manpage only available > though argparse (`./python foo.py --manpage`) This report isn't asking for that. (I see only one person proposing such an

[issue14102] argparse: add ability to create a man page

2018-06-14 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: >What would cause that confusion? This is not something that would >change how ‘argparse’ parses its arguments, so I don't know what >you're referring to. The (possible) confusion is the existence of a manpage only available though argparse (`./python

[issue14102] argparse: add ability to create a man page

2018-06-14 Thread Ben Finney
Ben Finney added the comment: On 14-Jun-2018, Pablo Galindo Salgado wrote: > I think this should be something that is not included in argparse > itself. I can imagine a scenario in which the manpage is accessible > through `./python foo.py --manpage` but the manpage is not installed >

[issue14102] argparse: add ability to create a man page

2018-06-14 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: I think this should be something that is not included in argparse itself. I can imagine a scenario in which the manpage is accessible through `./python foo.py --manpage` but the manpage is not installed systemwide. This will be very confusing for

[issue14102] argparse: add ability to create a man page

2018-06-14 Thread Pavel Raiskup
Change by Pavel Raiskup : -- nosy: +Pavel Raiskup ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue14102] argparse: add ability to create a man page

2017-04-19 Thread Zbyszek Jędrzejewski-Szmek
Zbyszek Jędrzejewski-Szmek added the comment: If you can import the module that defines the parser, and get at the generated parser, this should be trivial to integrate with the build system. Something like: PYTHONPATH=. python3 -c 'import mymodule; p=mymodule.make_parser();

[issue14102] argparse: add ability to create a man page

2017-04-19 Thread Louie Lu
Louie Lu added the comment: Sorry that I didn't figure out what you said in the previous msg. > provide a command-line interface for an end user I add a parameter that developer can switch command line option for man page, if the option is on, user can do this: ./python foo.py --manpage

[issue14102] argparse: add ability to create a man page

2017-04-19 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Your example just prints a man page. It doesn't do anything useful besides this. I'm asking how argparse can do two incompatible things: provide a command-line interface for an end user and generate a man page in a build script. Do you mean that the

[issue14102] argparse: add ability to create a man page

2017-04-19 Thread Louie Lu
Louie Lu added the comment: Also, `print_manpage` use the same infra as `print_help` and `print_usage`, so it can use the parameter `file` to output to different stream or file. -- ___ Python tracker

[issue14102] argparse: add ability to create a man page

2017-04-19 Thread Louie Lu
Louie Lu added the comment: Attachment is the poc of generating man page via `print_manpage`: $ ./python poc_2.py > output && man ./output -- Added file: http://bugs.python.org/file46812/poc_2.py ___ Python tracker

[issue14102] argparse: add ability to create a man page

2017-04-19 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: But how to use print_manpage()? Can you provide a new template of a program that uses argparse? -- ___ Python tracker

[issue14102] argparse: add ability to create a man page

2017-04-19 Thread Louie Lu
Louie Lu added the comment: > How to use this feature? > argparse is executed every time when the end user runs the program. > But generating a man page is the action that should be executed at > develop or build stage. > ... > How generating a man page should be invoked? For now, man page will

[issue14102] argparse: add ability to create a man page

2017-04-19 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: How to use this feature? argparse is executed every time when the end user runs the program. But generating a man page is the action that should be executed at develop or build stage. The end user gets a generated man page, he doesn't need the option to

[issue14102] argparse: add ability to create a man page

2017-04-18 Thread Louie Lu
Louie Lu added the comment: Hi all, I've created a PR for this, please help for code review. I found that previous method from Oz had a problem, that man page and general help page will share a Formatter, that cause an unexpected behavior that help page will generate with troff format (Unix

[issue14102] argparse: add ability to create a man page

2017-04-18 Thread Louie Lu
Changes by Louie Lu : -- pull_requests: +1300 ___ Python tracker ___ ___ Python-bugs-list

[issue14102] argparse: add ability to create a man page

2017-01-09 Thread paul j3
Changes by paul j3 : -- nosy: +paul.j3 ___ Python tracker ___ ___ Python-bugs-list

[issue14102] argparse: add ability to create a man page

2017-01-07 Thread Matt
Changes by Matt : -- nosy: +matthewjohn ___ Python tracker ___ ___

[issue14102] argparse: add ability to create a man page

2016-04-20 Thread Alessandro Cucci
Alessandro Cucci added the comment: I would like to work on a patch if nobody currently are working on it. I'll keep you updated -- nosy: +acucci ___ Python tracker

[issue14102] argparse: add ability to create a man page

2016-04-19 Thread Zbyszek Jędrzejewski-Szmek
Changes by Zbyszek Jędrzejewski-Szmek : -- nosy: +zbysz ___ Python tracker ___ ___

[issue14102] argparse: add ability to create a man page

2016-03-08 Thread Ben Finney
Changes by Ben Finney : -- versions: +Python 3.6 -Python 2.7 ___ Python tracker ___

[issue14102] argparse: add ability to create a man page

2016-03-08 Thread Ben Finney
Ben Finney added the comment: Oz Tiram wrote: > I doubt if the correct place for formatting a man page should be in > argparse.py itself. My solution is an extension of Andial's brecht solution Thank you for that, Oz. I see an easy seam to refactor this work into separate concerns. The

[issue14102] argparse: add ability to create a man page

2015-06-07 Thread Mathieu Bridon
Changes by Mathieu Bridon boche...@daitauha.fr: -- nosy: +bochecha ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14102 ___ ___ Python-bugs-list

[issue14102] argparse: add ability to create a man page

2015-06-07 Thread Mathieu Bridon
Mathieu Bridon added the comment: Any news on this? The code posted by Oz Tiram (I took the latest from his github repo) works quite well, even with Python 3. (I just tested it) It would be great if argparse could include the formatter class, as well as the distutils command. --

[issue14102] argparse: add ability to create a man page

2014-10-14 Thread Josh Rosenberg
Changes by Josh Rosenberg shadowranger+pyt...@gmail.com: -- nosy: +josh.rosenberg ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14102 ___ ___

[issue14102] argparse: add ability to create a man page

2014-10-13 Thread Aaron Meurer
Changes by Aaron Meurer asmeu...@gmail.com: -- nosy: +Aaron.Meurer ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14102 ___ ___ Python-bugs-list

[issue14102] argparse: add ability to create a man page

2014-06-13 Thread Oz Tiram
Oz Tiram added the comment: @Raymond Hettinger, You don't have to wait anymore. I would be happy if you review the patch, and share your opinion. I might have posted my patch too early. I am still doing changes on the upstream, in my github posted earlier.So, please test the one upstream.

[issue14102] argparse: add ability to create a man page

2014-06-12 Thread Raymond Hettinger
Raymond Hettinger added the comment: I have been wanting this feature for quite a long time Me too. -- nosy: +rhettinger ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14102 ___

[issue14102] argparse: add ability to create a man page

2014-06-11 Thread Oz Tiram
Oz Tiram added the comment: Hi, I have been wanting this feature for quite a long time. IMHO, binaries and scripts should always include a man page. The Debian developers require that. However, man pages have a 'bizarre' format. Long talk, short time. I did implement something. I tested it

[issue14102] argparse: add ability to create a man page

2014-06-11 Thread Thomas Guettler
Changes by Thomas Guettler guet...@thomas-guettler.de: -- nosy: -guettli ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14102 ___ ___

[issue14102] argparse: add ability to create a man page

2013-01-11 Thread Thomas Guettler
Changes by Thomas Guettler guet...@thomas-guettler.de: -- nosy: +guettli ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14102 ___ ___

[issue14102] argparse: add ability to create a man page

2012-12-03 Thread Christoph Sieghart
Changes by Christoph Sieghart s...@0x2a.at: -- nosy: +sigi ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14102 ___ ___ Python-bugs-list mailing

[issue14102] argparse: add ability to create a man page

2012-06-12 Thread Jakub Wilk
Changes by Jakub Wilk jw...@jwilk.net: -- nosy: +jwilk ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14102 ___ ___ Python-bugs-list mailing list

[issue14102] argparse: add ability to create a man page

2012-04-14 Thread Andrew Regner
Changes by Andrew Regner and...@aregner.com: -- nosy: +adregner ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14102 ___ ___ Python-bugs-list

[issue14102] argparse: add ability to create a man page

2012-03-12 Thread Ingo Fischer
Changes by Ingo Fischer fredistdurs...@googlemail.com: -- nosy: +Ingo.Fischer ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14102 ___ ___

[issue14102] argparse: add ability to create a man page

2012-02-25 Thread Andi Albrecht
Changes by Andi Albrecht albrecht.a...@gmail.com: -- nosy: +andialbrecht ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14102 ___ ___

[issue14102] argparse: add ability to create a man page

2012-02-25 Thread Éric Araujo
Éric Araujo mer...@netwok.org added the comment: Andi, the author of the blog post, will work on a patch. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14102 ___

[issue14102] argparse: add ability to create a man page

2012-02-24 Thread Steven Bethard
Steven Bethard steven.beth...@gmail.com added the comment: I think adding a new formatter for man pages would be generally useful. Assuming someone provides a patch. ;-) -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14102

[issue14102] argparse: add ability to create a man page

2012-02-24 Thread Tshepang Lekhonkhobe
Changes by Tshepang Lekhonkhobe tshep...@gmail.com: -- nosy: +tshepang ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14102 ___ ___

[issue14102] argparse: add ability to create a man page

2012-02-24 Thread Éric Araujo
Éric Araujo mer...@netwok.org added the comment: Alright :) I’ve contacted the author of the blog article to ask him if we can reuse his code. -- stage: - needs patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14102

[issue14102] argparse: add ability to create a man page

2012-02-23 Thread Éric Araujo
Éric Araujo mer...@netwok.org added the comment: Are you aware of help2man? It can transmogrify the output of “your-program-that-uses-argparse --help” to a man page. Another solution is to use docutils’ rst2man to convert some documentation file to the man format. On the other hand, this

[issue14102] argparse: add ability to create a man page

2012-02-23 Thread Éric Araujo
Éric Araujo mer...@netwok.org added the comment: Forgot the link to the blog post: https://andialbrecht.wordpress.com/2009/03/17/creating-a-man-page-with-distutils-and-optparse/ -- ___ Python tracker rep...@bugs.python.org