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 Brett.Hannigan, Drake Bridgewater, barry, bethard, derks, floreal, mattlong, paul.j3, r.david.murray
Date 2018-05-03.20:26:36
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1525379196.68.0.682650639539.issue22848@psf.upfronthosting.co.za>
In-reply-to
Content
I've reviewed the comments and proposed patch, and still think that the custom metavar is still the best fix.

subparses.metavar  can be changed after subparsers has been created.  The programmer could, for example, write a simple helper function that calls add_parser, and also appends names to a list.  Then at the end, turn that list into a properly formatted metavar string.

    subparsers.metavar = '(%s}'%','.join(['cmd1','foo','cmd3'])

In fact, if I were to write a patch, I'd take this approach, trying to confine all changes to the _SubParsersAction.add_parser method, and out of the HelpFormatter.
History
Date User Action Args
2018-05-03 20:26:36paul.j3setrecipients: + paul.j3, barry, bethard, r.david.murray, derks, mattlong, Brett.Hannigan, Drake Bridgewater, floreal
2018-05-03 20:26:36paul.j3setmessageid: <1525379196.68.0.682650639539.issue22848@psf.upfronthosting.co.za>
2018-05-03 20:26:36paul.j3linkissue22848 messages
2018-05-03 20:26:36paul.j3create