[issue26967] argparse: allow_abbrev=False stops -vv from working

paul j3 report at bugs.python.org
Sun May 8 15:47:36 EDT 2016


paul j3 added the comment:

It's been 2 years since I worked on this patch.  In the issue discussion http://bugs.python.org/issue14910 there was no mention of short v long options.  The unit tests only look at longs.

The result is that with the abbrev off, it disables all use of combined shorts, not just the count.  Not only if '-vv' disabled, so is '-vz', '-vz1', '-v -z1'.

We should have discussed that issue.

I can imagine modifying the 

    if self.allow_abbrev:

to something like

    if self.allow_abbrev or <argstring has only one dash>:
        <search for abbreviations>

But even if we don't go that far, we should add a documentation note.

----------
nosy: +paul.j3

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


More information about the Python-bugs-list mailing list