Message211132
The attached file shows how the default argument groups could be redefined, using 'required' as the criteria.
I've implemented it as a method that is added to a subclass of ArgumentParser. This method is invoked after arguments are defined, prior to generating the help.
The help looks something like this:
usage: alt_grouping.py [-h] [-f FOO] -g GOO pos [baz]
required:
pos required positional
-g GOO, --goo GOO required optional
optional:
-h, --help show this help message and exit
-f FOO, --foo FOO optional
baz optional positional
I was thinking of implementing this as a formatter subclass, but given the way the help is assembled, invoking this method from the parser is simpler. |
|
| Date |
User |
Action |
Args |
| 2014-02-13 08:34:38 | paul.j3 | set | recipients:
+ paul.j3, rhettinger, terry.reedy, bethard, eric.smith, eric.araujo, r.david.murray, docs@python, benschmaus, tshepang, martin.panter, mburger, Martin.d'Anjou |
| 2014-02-13 08:34:38 | paul.j3 | set | messageid: <[email protected]> |
| 2014-02-13 08:34:38 | paul.j3 | link | issue9694 messages |
| 2014-02-13 08:34:37 | paul.j3 | create | |
|