Message350415
https://bugs.python.org/issue26510
https://bugs.python.org/issue33109
There was some flip/flop over whether required should be true by default or not - the current behavior is False, (the 3.3.0)
The lasting change since this issue in 2012 is that `add_subparsers` now takes the 'required' parameter. And this is documented.
To avoid the problem raising in this issue, the subparsers should be defined with:
p1 = parser.add_subparsers(required=True, dest='cmd')
The 'dest' parameter is documented, but that fact that it is needed with required=True is not. Without it you can get an error when missing-argument is being formatted. Without it the error formatter doesn't know what to call this argument. I've mentioned this in one or more issues.
See my SO answer for discussion on this:
https://stackoverflow.com/questions/23349349/argparse-with-required-subparser/23354355#23354355 |
|
Date |
User |
Action |
Args |
2019-08-25 00:50:08 | paul.j3 | set | recipients:
+ paul.j3, bethard, Arfrever, r.david.murray, asvetlov, maker, telmich, epicfaace |
2019-08-25 00:50:08 | paul.j3 | set | messageid: <1566694208.95.0.731764671762.issue16308@roundup.psfhosted.org> |
2019-08-25 00:50:08 | paul.j3 | link | issue16308 messages |
2019-08-25 00:50:08 | paul.j3 | create | |
|