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. |