[issue14365] argparse: subparsers, argument abbreviations and ambiguous option

Jakub Warmuz report at bugs.python.org
Mon Mar 19 19:10:16 CET 2012


Jakub Warmuz <jakub.warmuz+bugs.python.org at gmail.com> added the comment:

Attached quick&dirty fix I'm currently using in my project. Maybe this will help to create a valid patch.

Instead of changing _parse_optional, I've overridden _get_option_tuples to scan subparsers for matching optional arguments if option is ambiguous in the current parser.

I've only skimmed through the code, so forgive me if that fix is useless.

----------
Added file: http://bugs.python.org/file24945/argparse_dirty_hack.py

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


More information about the Python-bugs-list mailing list