This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author paul.j3
Recipients paul.j3, rhettinger, will
Date 2021-01-21.21:12:37
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1611263558.05.0.266755772192.issue42980@roundup.psfhosted.org>
In-reply-to
Content
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).
History
Date User Action Args
2021-01-21 21:12:38paul.j3setrecipients: + paul.j3, rhettinger, will
2021-01-21 21:12:38paul.j3setmessageid: <1611263558.05.0.266755772192.issue42980@roundup.psfhosted.org>
2021-01-21 21:12:38paul.j3linkissue42980 messages
2021-01-21 21:12:37paul.j3create