Message284874
subparsers is an example of choices displaying as the metavar. From the documentation example:
usage: PROG [-h] [--foo] {a,b} ...
positional arguments:
{a,b} sub-command help
-----------------
To the main parser, the 'subparser' is a positional argument, with an optional 'dest' parameter (default is SUPPRESS), and {a,b} are the choices derived from the define subparser names.
The 'title' and 'description' parameters are used to create an Argument_group.
So any attempt to change how the metavar is created from choices has the potential of changing the subparser display.
That does suggest another formatting option - put your positional argument (with choices) in a custom Argument_Group.
In [658]: p=argparse.ArgumentParser()
In [659]: g=p.add_argument_group(title='lengths')
In [660]: g.add_argument('length',choices=[1,2,3]);
In [661]: p.print_help()
usage: ipython3 [-h] {1,2,3}
optional arguments:
-h, --help show this help message and exit
lengths:
{1,2,3} |
|
Date |
User |
Action |
Args |
2017-01-06 23:49:16 | paul.j3 | set | recipients:
+ paul.j3, r.david.murray, cykerway |
2017-01-06 23:49:16 | paul.j3 | set | messageid: <1483746556.23.0.725870129211.issue29030@psf.upfronthosting.co.za> |
2017-01-06 23:49:16 | paul.j3 | link | issue29030 messages |
2017-01-06 23:49:15 | paul.j3 | create | |
|