Message166217
I set a positional argument and an optional argument that accepts a list:
> parser = argparse.ArgumentParser()
> parser.add_argument('foo')
> parser.add_argument('-bar', nargs='*')
The usage line I get from --help is this:
> $ example.py --help
> usage: example.py [-h] [-bar [BAR [BAR ...]]] foo
Trying to actually follow the usage instructions produces this error:
> $ example.py -bar x y z
> error: too few arguments
Reversing the argument order works however:
> $ example.py z -bar x y
So the usage instructions are clearly wrong. |
|
Date |
User |
Action |
Args |
2012-07-23 09:48:38 | slikts | set | recipients:
+ slikts |
2012-07-23 09:48:38 | slikts | set | messageid: <1343036918.13.0.713633576876.issue15433@psf.upfronthosting.co.za> |
2012-07-23 09:48:37 | slikts | link | issue15433 messages |
2012-07-23 09:48:37 | slikts | create | |
|