[issue9444] argparse does not honor prefix_chars when adding default options

Theodore Turocy report at bugs.python.org
Sun Aug 1 04:09:31 CEST 2010


Theodore Turocy <drarbiter at gmail.com> added the comment:

What is the appropriate behavior for long options when '-' is not one of the accepted prefix_chars?  All of '-h', '--help', '-v', and '--version' are hardcoded in the ctor.  If, for instance, prefix_chars='+', should the long options be '++help', or should long options simply be disabled?

Also, for backwards compatibility, to implement Doug Hellmann's suggestion, '-' should be used for '-h' and '--help' whenever '-' is listed in prefix_chars (so, e.g., prefix_chars='+-' will result in the same behavior as previous versions). 

I have a working patch for this but wouldn't mind someone else's thoughts first.

----------
nosy: +ted.turocy

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue9444>
_______________________________________


More information about the Python-bugs-list mailing list