[issue9652] Enhance argparse help output customizability

Steven Bethard report at bugs.python.org
Sun Mar 27 16:09:31 CEST 2011


Steven Bethard <steven.bethard at gmail.com> added the comment:

I'm moving this over to Issue 11695, which proposes support for a usage/help message template.

To customize the argument group names, the recommended approach is to create your own argument groups, and only put arguments there, e.g.:

parser = argparse.ArgumentParser(add_help=False)
flags = parser.add_argument_group('My Optional Arguments')
flags.add_argument('-h', '--help', action='help')
flags.add_argument('-v', action='version', version='1.3')

Then you'll get just the "My Optional Arguments" heading.

----------
resolution:  -> duplicate
stage: test needed -> committed/rejected
status: open -> closed
superseder:  -> Improve argparse usage/help customization

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue9652>
_______________________________________


More information about the Python-bugs-list mailing list