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 forest, jkloth, paul.j3, rhettinger
Date 2021-09-06.04:58:38
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1630904318.83.0.19457001248.issue45110@roundup.psfhosted.org>
In-reply-to
Content
This is has been requested various times on StackOverflow, and possibly here (I'd have to do a search).

The closest thing to making a compact action_invocation is to set the metavar to '', and even thing we get a space, eg.

     -f , --foo   Help text

This repeat has been a part of argparse from the beginning, so I can't see changing the default behavior.  But we could add a HelpFormatter subclass that changes one (or two methods) such as _format_action_invocation.  Subclassing the formatter is the accepted way of adding help features.   I, and possibly others, must have suggested such a change on SO.

Of course people can use such a subclass without it being part of the standard module.
History
Date User Action Args
2021-09-06 04:58:38paul.j3setrecipients: + paul.j3, rhettinger, forest, jkloth
2021-09-06 04:58:38paul.j3setmessageid: <1630904318.83.0.19457001248.issue45110@roundup.psfhosted.org>
2021-09-06 04:58:38paul.j3linkissue45110 messages
2021-09-06 04:58:38paul.j3create