Theodore Turocy <[email protected]> added the comment: 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. ---------- keywords: +patch Added file: http://bugs.python.org/file18298/argparse_char_fix.patch _______________________________________ Python tracker <[email protected]> <http://bugs.python.org/issue9444> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
