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 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) ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue14102> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com