[issue37227] Wrong parse long argument

2019-06-12 Thread paul j3
Change by paul j3 : -- nosy: +paul.j3 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org

[issue37227] Wrong parse long argument

2019-06-11 Thread Eric V. Smith
Eric V. Smith added the comment: Although note that with allow_abbrev=False, -l will conflict with --long, which I'm not sure is a great design. I'm closing this as not a bug, since it works as documented and there's a workaround (albeit not in 2.7, which is closed to new features). ---

[issue37227] Wrong parse long argument

2019-06-11 Thread Karthikeyan Singaravelan
Karthikeyan Singaravelan added the comment: argparse allows abbreviations by default so --li matches --list as a prefix match. This is documented at https://docs.python.org/2.7/library/argparse.html#argument-abbreviations-prefix-matching >From python 3.5 allow_abbrev=False can be passed to A

[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) -- ___

[issue37227] Wrong parse long argument

2019-06-11 Thread Karthikeyan Singaravelan
Change by Karthikeyan Singaravelan : -- nosy: +xtreak ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https:/

[issue37227] Wrong parse long argument

2019-06-11 Thread Eric V. Smith
Eric V. Smith added the comment: And what is your expected result, and why? -- nosy: +eric.smith ___ Python tracker ___ ___ Python-

[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"