[issue37227] Wrong parse long argument

2019-06-11 Thread chr0139


New submission from chr0139 :

I have this script

import argparse
parser = argparse.ArgumentParser()
group = parser.add_mutually_exclusive_group()
group.add_argument('-l', '--list', action='store_true', help="show help")
group.add_argument('-u', '--upgrade', action='store_true', help="show help")
parser.parse_args(['--li'])

and this is the unexpected result:

Namespace(list=True, upgrade=False)

--
components: Library (Lib)
messages: 345203
nosy: chr0139
priority: normal
severity: normal
status: open
title: Wrong parse long argument
type: behavior
versions: Python 2.7

___
Python tracker 
<https://bugs.python.org/issue37227>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37227] Wrong parse long argument

2019-06-11 Thread chr0139


chr0139  added the comment:

I think --li is not the same argument as --list

So I expect that

parser.parse_args(['-l']) or parser.parse_args(['--list'])

should be only two options which should leads to the result

Namespace(list=True, upgrade=False)

--

___
Python tracker 
<https://bugs.python.org/issue37227>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com