[issue9652] Tidy argparse default output

Steven Bethard report at bugs.python.org
Fri Aug 27 16:27:26 CEST 2010


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

Looks like "usage" is almost always lowercase in the programs I tried (ssh, svn, cat, etc.). So it probably wouldn't be a good idea to change the default. Seems like both this and issue 9694 need a better way to customize the text in argparse mesages.

As a temporary workaround for the group names, you can try:

parser._optionals.title = "Optional arguments"
parser._positionals.title = "Positional arguments"

I can't guarantee this will continue to work since it relies on internal details but at least it would work for the time being.

----------

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


More information about the Python-bugs-list mailing list