Message310540
I attached a script that implements Evan's _match_argument idea, using a ArgumentParser subclass. I think this is the safest way to add different functionality to the parser. It (subclassing) is used, for example in pypi extensions like plac.
My version places the special nargs case after the default match test. So it acts only if the regular action fails. But I don't know of a test case where that difference matters.
I've tested it with all the examples posted in this issue, but have not tested it against test_argparse.py. I'd also like to know if it goes far enough in adapting to optparse/POSIX usage. It probably doesn't. |
|
Date |
User |
Action |
Args |
2018-01-24 00:35:35 | paul.j3 | set | recipients:
+ paul.j3, rhettinger, cben, amcnabb, bethard, eric.smith, eric.araujo, r.david.murray, memeplex, gfxmonk, evaned, andersk, abacabadabacaba, gdb, nelhage, drm, davidben, martin.panter, skilletaudio, Christophe.Guillon, danielsh, spaceone, Clint Olsen, karzes |
2018-01-24 00:35:35 | paul.j3 | set | messageid: <1516754135.16.0.467229070634.issue9334@psf.upfronthosting.co.za> |
2018-01-24 00:35:35 | paul.j3 | link | issue9334 messages |
2018-01-24 00:35:35 | paul.j3 | create | |
|