Message178481
Was argparse ever supposed to support inputs of the form given in the example (i.e. different positional arguments straddling optional arguments): 'yy -x zz'?
The usage string shows up as: "usage: test.py [-h] [-x] y [z [z ...]]" The original example seems to work with the current code if given as: '-x yy zz'.
Also, substituting argparse.REMAINDER for '*' in the original example gives the following both with and without the patch:
Namespace(x=False, y='yy', z=['-x', 'zz'])
That doesn't seem consistent with straddling being supported.
Lastly, passing just '-x' gives the following error with and without the patch (z should be optional):
error: the following arguments are required: y, z |
|
Date |
User |
Action |
Args |
2012-12-29 08:50:41 | chris.jerdonek | set | recipients:
+ chris.jerdonek, bethard, gfxmonk, tshepang, waltermundt |
2012-12-29 08:50:41 | chris.jerdonek | set | messageid: <1356771041.26.0.720974725499.issue15112@psf.upfronthosting.co.za> |
2012-12-29 08:50:41 | chris.jerdonek | link | issue15112 messages |
2012-12-29 08:50:41 | chris.jerdonek | create | |
|