Message181164
Unfortunatelly the implementation bugous as of now. I wrote additional tests.
self.parser = ErrorRaisingArgumentParser()
self.parser.add_argument('-a', action='store_true')
self.parser.add_argument('-b')
self.parser.add_argument('rem', nargs=argparse.REMAINDER)
self.assertEquals(self.parser.parse_args('-b 4 -a -b 5'.split()), NS(a=True, b='5', rem=[]))
This part is OK. But with the new option:
self.parser.disable_interspersed_args()
self.assertEquals(self.parser.parse_args('-b 4 -a -b 5'.split()), NS(a=False, b='4', rem=['-a', '-b', '5']))
This assertation also passes because it contains the actual result, which is unexpected. This is because the code doesn't handle properly the arguments that are non-options, such as '-b' in this case.
I can't see a good solution for this. |
|
Date |
User |
Action |
Args |
2013-02-02 11:54:26 | Laszlo.Attila.Toth | set | recipients:
+ Laszlo.Attila.Toth, bethard, kalt |
2013-02-02 11:54:26 | Laszlo.Attila.Toth | set | messageid: <1359806066.37.0.823347202978.issue13966@psf.upfronthosting.co.za> |
2013-02-02 11:54:26 | Laszlo.Attila.Toth | link | issue13966 messages |
2013-02-02 11:54:26 | Laszlo.Attila.Toth | create | |
|