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 ted.turocy
Recipients bethard, doughellmann, ted.turocy
Date 2010-08-01.02:40:16
SpamBayes Score 0.015807398
Marked as misclassified No
Message-id <1280630420.05.0.348992253922.issue9444@psf.upfronthosting.co.za>
In-reply-to
Content
Looking at the test fixtures that exercise argparse, it appears that the intended behavior when '-' is not a prefix_char is to accept a doubling of any of the prefix_chars for long arguments.  That is, if '-' is not present in prefix_chars but ':' is, then an argument like '::help' would be a valid long argument.

I'm attaching a patch which fixes the originally reported problem as follows:

* If '-' is in prefix_chars, then the help and version arguments are '-h', '--help', '-v', '--version'
* If '-' is not in prefix_chars, then the first char in prefix_chars is used to lead the option, e.g., '+h', '++help', '+v', '++version' if prefix_chars starts with '+'.

Catherine Devlin is also sprinting here at PyOhio and will have a test fixture separately.
History
Date User Action Args
2010-08-01 02:40:20ted.turocysetrecipients: + ted.turocy, bethard, doughellmann
2010-08-01 02:40:20ted.turocysetmessageid: <1280630420.05.0.348992253922.issue9444@psf.upfronthosting.co.za>
2010-08-01 02:40:18ted.turocylinkissue9444 messages
2010-08-01 02:40:17ted.turocycreate