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 eric.smith
Recipients andersk, bethard, drm, eric.smith, gdb, nelhage, r.david.murray
Date 2011-02-05.20:54:37
SpamBayes Score 0.00011127289
Marked as misclassified No
Message-id <1296939278.25.0.584115216734.issue9334@psf.upfronthosting.co.za>
In-reply-to
Content
While I also dislike the existing behavior, note that you can get what you want by using an equal sign.

>>> import argparse
>>> parser = argparse.ArgumentParser(prog='a2x')
>>> parser.add_argument('--asciidoc-opts',
... action='store', dest='asciidoc_opts', default=''
... metavar='ASCIIDOC_OPTS', help='asciidoc options')
>>> parser.parse_args(['--asciidoc-opts', '-1'])
Namespace(asciidoc_opts='-1')
>>> parser.parse_args(['--asciidoc-opts=-one'])
Namespace(asciidoc_opts='-one')

I always use the equal sign, so I've never noticed this behavior before.

I wish that help would display the equal sign, but that's another issue.
History
Date User Action Args
2011-02-05 20:54:38eric.smithsetrecipients: + eric.smith, bethard, r.david.murray, andersk, gdb, nelhage, drm
2011-02-05 20:54:38eric.smithsetmessageid: <1296939278.25.0.584115216734.issue9334@psf.upfronthosting.co.za>
2011-02-05 20:54:37eric.smithlinkissue9334 messages
2011-02-05 20:54:37eric.smithcreate