Message128025
| 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. |
|