paul j3 <[email protected]> added the comment:
The refactoring looks reasonable.
But while we are tweaking:
def _format_action_invocation(self, action):
I wonder if we also give users more control over how multiple option strings
are formatted. Currently if
parser.add_argument('-f', '--foo', help='something')
the help line will be
-f FOO, --foo FOO something
with this alternate formatter it would be (I think)
-f FOO, --foo=FOO something
But with longer option strings users often want
-f, --foo FOO something
or even just
-f, --foo something
we can almost get the last with `metavar=''`
-f , --foo something
which has a superfluous space before the comma.
I don't recall if there's already a bug/issue for this or not. Maybe the fix
is a subclass with a complete replacement of this _format_action_invocation
method. I'll have do more research (here and on Stackoverflow).
----------
_______________________________________
Python tracker <[email protected]>
<https://bugs.python.org/issue42980>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com