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 ThatXliner
Recipients ThatXliner, paul.j3, rhettinger
Date 2020-10-14.18:45:06
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1602701107.01.0.173452079456.issue42023@roundup.psfhosted.org>
In-reply-to
Content
> So if you can get by with just customizing _format_action_invocation, there's no need for further action here.

Then maybe we could just make a new function that takes 2 arguments: Name of another action class (or the action class itself), and a tuple of the arg names to be displayed. It returns a new action class that contains the help text properties of the given action class with customized displayed arg names.


Maybe like

parser.add_argument("-f", "--foo", action=argparse.CustomArgName(action="store_true", name=("-F!!", "--FOO!"), help="TO foo a bar"))
History
Date User Action Args
2020-10-14 18:45:07ThatXlinersetrecipients: + ThatXliner, rhettinger, paul.j3
2020-10-14 18:45:07ThatXlinersetmessageid: <1602701107.01.0.173452079456.issue42023@roundup.psfhosted.org>
2020-10-14 18:45:07ThatXlinerlinkissue42023 messages
2020-10-14 18:45:06ThatXlinercreate