New submission from Michael Kruse:
#! /usr/bin/env python3
import argparse
parser = argparse.ArgumentParser(allow_abbrev=True)
parser.add_argument('-v', '--verbose', action='count')
print(parser.parse_args(['-vv']))
parser = argparse.ArgumentParser(allow_abbrev=False)
parser.add_argument('-v', '--verbose', action='count')
print(parser.parse_args(['-vv']))
Observed Output:
Namespace(verbose=2)
usage: test.py [-h] [-v]
test.py: error: unrecognized arguments: -vv
Expected Output:
Namespace(verbose=2)
Namespace(verbose=2)
----------
components: Library (Lib)
messages: 264915
nosy: meinersbur
priority: normal
severity: normal
status: open
title: argparse: allow_abbrev=False stops -vv from working
type: behavior
versions: Python 3.5
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue26967>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com