[issue27303] [argparse] Unify options in help output

paul j3 report at bugs.python.org
Sun Jun 12 19:17:58 EDT 2016


paul j3 added the comment:

There are 2 issues here - 

- how to make the 'choices' list most compact

- how to make the multiple option strings display (long and short) more compact, regardless of why the argument part is long.

When the choices display is too long, 'metavar' is a handy alternative.  You can still display the choices in the body of the help message, either as an explicit list or with the `%(choices)s` string.  The long choices list will still appear in the error messages.

There are other bug/issues about formatting the choices list.

I have participated in discussions about replacing

    -f FOO, --foo FOO etc 

with

    -f/--foo FOO etc

I'm sure that's been raised on Stackoverflow, but there might also be a bug/issue on the topic.  I'd have to do some search to find those.  I believe it can addressed with a HelpFormatter subclass that changes one method.

----------
nosy: +paul.j3

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


More information about the Python-bugs-list mailing list