This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author Daniel.Walsh
Recipients Aaron.Meurer, Daniel.Walsh, Ingo.Fischer, Oz.Tiram, Pavel Raiskup, acucci, adregner, andialbrecht, asmeurer, bethard, bignose, bochecha, dmalcolm, eric.araujo, josh.r, jwilk, louielu, matthewjohn, pablogsal, paul.j3, rhettinger, serhiy.storchaka, sigi, tshepang, zbysz
Date 2018-06-15.09:54:03
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <005ca94e-76c7-675d-7515-0e24d7ec8e4c@redhat.com>
In-reply-to <1529018110.2252474.1408579256.6512E493@webmail.messagingengine.com>
Content
On 06/14/2018 07:15 PM, Ben Finney wrote:
> Ben Finney <ben+python@benfinney.id.au> added the comment:
>
> On Thu, 2018-06-14 20:02 +0000, Pablo Galindo Salgado <report@bugs.python.org> 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 interface, and even that person said it's not a good idea.) So please don't conflate that with the original bug report.
>
>> I am  not sure how many people do something like `./python poc_2.py > output
>> && man ./output` to **read** the manpage.
> Right, I am not asking for anything like that; I'm not asking that ‘argparse’ grow a way to read a manual page,. I am asking only for a standard way to programmatically generate that manual page from the information ‘argparse’ already knows.
>
>>> This is asking that the ‘argparse’ library should have an API to
>>> create a manual page, for use in the build system.
>> At this point argparse is user facing in the sense that once configured,
>> it provides functionality for the user of the command line application.
>> My opinion is that it will be weird to have it provide also APIs for
>> creating man pages (which is a developer utility).
> Creating an argument parser itself is already a developer activity, and we don't see that as weird that ‘argparse’ allows for that.
>
> I'm arguing that the library already knows how to turn the argument collection into a user-facing document (the usage message), and a manual page is a different way of rendering that same internal data. So that's why ‘argparse’ is a consistent place to have that functionality.
>
>> My humble opinion is
>> that it if argparse starts to provide APIs for usage at install time is
>> not "doing one thing and doing it well".
> That API already exists: the specific ‘ArgumentParser’ is available to be imported for a program which defines one. So, the library already provides APIs for usage at install time (or any other run-time).
>
> I am asking to make that API more useful for the distribution of programs.
>
> ----------
>
> _______________________________________
> Python tracker <report@bugs.python.org>
> <https://bugs.python.org/issue14102>
> _______________________________________

Correct, the reason I would want this is to add something to a Makefile 
to automatically generate a man page, when you do a make install

manpages: foo.py
	./python foo.py --manpage > foo.1
install.manpages: manpages
	install -D -m 644 foo.1 ${DESTDIR}/usr/share/man/man1
History
Date User Action Args
2018-06-15 09:54:03Daniel.Walshsetrecipients: + Daniel.Walsh, rhettinger, bethard, jwilk, eric.araujo, zbysz, dmalcolm, Aaron.Meurer, bignose, andialbrecht, bochecha, tshepang, paul.j3, sigi, serhiy.storchaka, Ingo.Fischer, adregner, josh.r, Oz.Tiram, acucci, matthewjohn, louielu, pablogsal, asmeurer, Pavel Raiskup
2018-06-15 09:54:03Daniel.Walshlinkissue14102 messages
2018-06-15 09:54:03Daniel.Walshcreate