Message316137
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. |
|
Date |
User |
Action |
Args |
2018-05-03 20:26:36 | paul.j3 | set | recipients:
+ paul.j3, barry, bethard, r.david.murray, derks, mattlong, Brett.Hannigan, Drake Bridgewater, floreal |
2018-05-03 20:26:36 | paul.j3 | set | messageid: <1525379196.68.0.682650639539.issue22848@psf.upfronthosting.co.za> |
2018-05-03 20:26:36 | paul.j3 | link | issue22848 messages |
2018-05-03 20:26:36 | paul.j3 | create | |
|