Message291882
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
and open the manpage, but I think this isn't a good approach, since normal user will simply use `man foo.py`.
> generate a man page in a build script.
> Do you mean that the programmer should create a separate script for generating a man page and copy a part of the code from the main program? This workflow should be documented, with examples. And it is not applicable for simple one-file scripts.
I not sure if argparse need to provide a setuptools command, if need, the approach that Oz provide can be used, and developer only need to do like this in setup.py
from argparser import build_manpage
cmdclass={'build_manpage': build_manpage}
then at the command line, developer can build manpage as `./python setup.py build_manpage --output=foo.1 --parser=foo.parser`
If provide this is function too far for argparse, then as you said, a well-documented workflow should be provided.
----
Even if argparse provide this function, end-user still can't easily do the trick `man foo.py` or `man foo` if script point is provide in setup.py. If need to approach things like `man foo`, it may need to integrate with setuptools to put the man page file to the correct path (e.g. /usr/share/man/man1) |
|
Date |
User |
Action |
Args |
2017-04-19 12:29:12 | louielu | set | recipients:
+ louielu, rhettinger, bethard, jwilk, eric.araujo, zbysz, dmalcolm, Aaron.Meurer, bignose, andialbrecht, bochecha, tshepang, paul.j3, sigi, Daniel.Walsh, serhiy.storchaka, Ingo.Fischer, adregner, josh.r, Oz.Tiram, acucci, matthewjohn |
2017-04-19 12:29:12 | louielu | set | messageid: <1492604952.22.0.423958783405.issue14102@psf.upfronthosting.co.za> |
2017-04-19 12:29:12 | louielu | link | issue14102 messages |
2017-04-19 12:29:12 | louielu | create | |
|