This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author slikts
Recipients slikts
Date 2012-07-23.09:48:37
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1343036918.13.0.713633576876.issue15433@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2012-07-23 09:48:38sliktssetrecipients: + slikts
2012-07-23 09:48:38sliktssetmessageid: <1343036918.13.0.713633576876.issue15433@psf.upfronthosting.co.za>
2012-07-23 09:48:37sliktslinkissue15433 messages
2012-07-23 09:48:37sliktscreate