diff options
author | steven.bethard <devnull@localhost> | 2009-12-07 00:56:45 +0000 |
---|---|---|
committer | steven.bethard <devnull@localhost> | 2009-12-07 00:56:45 +0000 |
commit | 595bce353fc65c44168df31a9cd3e29b9059b486 (patch) | |
tree | 00044595d631f68c64a1ce75fa68aa0c7ac1e36f /argparse.py | |
parent | d8a9e95d1809e508aa8720b26e98510ef414aa0e (diff) | |
download | argparse-595bce353fc65c44168df31a9cd3e29b9059b486.tar.gz |
Fix bug where --si=64 was deemed ambiguous when both --si and --size were in the parser.
Diffstat (limited to 'argparse.py')
-rw-r--r-- | argparse.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/argparse.py b/argparse.py index 16a778f..8b96e62 100644 --- a/argparse.py +++ b/argparse.py @@ -2036,6 +2036,13 @@ class ArgumentParser(_AttributeHolder, _ActionsContainer): action = self._option_string_actions[arg_string] return action, arg_string, None + # if the option string before the "=" is present, return the action + if '=' in arg_string: + option_string, explicit_arg = arg_string.split('=', 1) + if option_string in self._option_string_actions: + action = self._option_string_actions[option_string] + return action, option_string, explicit_arg + # search through all possible prefixes of the option string # and all actions in the parser for possible interpretations option_tuples = self._get_option_tuples(arg_string) |