Lines Matching refs:option_string

444                 option_string = action.option_strings[0]
449 part = '%s' % option_string
456 part = '%s %s' % (option_string, args_string)
556 for option_string in action.option_strings:
557 parts.append('%s %s' % (option_string, args_string))
805 def __call__(self, parser, namespace, values, option_string=None): argument
840 def __call__(self, parser, namespace, values, option_string=None): argument
863 def __call__(self, parser, namespace, values, option_string=None): argument
932 def __call__(self, parser, namespace, values, option_string=None): argument
958 def __call__(self, parser, namespace, values, option_string=None): argument
980 def __call__(self, parser, namespace, values, option_string=None): argument
999 def __call__(self, parser, namespace, values, option_string=None): argument
1020 def __call__(self, parser, namespace, values, option_string=None): argument
1077 def __call__(self, parser, namespace, values, option_string=None): argument
1333 for option_string in action.option_strings:
1334 self._option_string_actions[option_string] = action
1337 for option_string in action.option_strings:
1338 if self._negative_number_matcher.match(option_string):
1408 for option_string in args:
1410 if not option_string[0] in self.prefix_chars:
1413 tup = option_string, self.prefix_chars
1417 option_strings.append(option_string)
1418 if option_string[0] in self.prefix_chars:
1419 if len(option_string) > 1:
1420 if option_string[1] in self.prefix_chars:
1421 long_option_strings.append(option_string)
1433 raise ValueError(msg % option_string)
1456 for option_string in action.option_strings:
1457 if option_string in self._option_string_actions:
1458 confl_optional = self._option_string_actions[option_string]
1459 confl_optionals.append((option_string, confl_optional))
1468 conflict_string = ', '.join([option_string
1469 for option_string, action
1476 for option_string, action in conflicting_actions:
1479 action.option_strings.remove(option_string)
1480 self._option_string_actions.pop(option_string, None)
1793 def take_action(action, argument_strings, option_string=None): argument
1811 action(self, namespace, argument_values, option_string)
1818 action, option_string, explicit_arg = option_tuple
1840 if arg_count == 0 and option_string[1] not in chars:
1841 action_tuples.append((action, [], option_string))
1842 char = option_string[0]
1843 option_string = char + explicit_arg[0]
1846 if option_string in optionals_map:
1847 action = optionals_map[option_string]
1858 action_tuples.append((action, args, option_string))
1876 action_tuples.append((action, args, option_string))
1882 for action, args, option_string in action_tuples:
1883 take_action(action, args, option_string)
2079 option_string, explicit_arg = arg_string.split('=', 1)
2080 if option_string in self._option_string_actions:
2081 action = self._option_string_actions[option_string]
2082 return action, option_string, explicit_arg
2090 options = ', '.join([option_string
2091 for action, option_string, explicit_arg in option_tuples])
2116 def _get_option_tuples(self, option_string): argument
2122 if option_string[0] in chars and option_string[1] in chars:
2123 if '=' in option_string:
2124 option_prefix, explicit_arg = option_string.split('=', 1)
2126 option_prefix = option_string
2128 for option_string in self._option_string_actions:
2129 if option_string.startswith(option_prefix):
2130 action = self._option_string_actions[option_string]
2131 tup = action, option_string, explicit_arg
2137 elif option_string[0] in chars and option_string[1] not in chars:
2138 option_prefix = option_string
2140 short_option_prefix = option_string[:2]
2141 short_explicit_arg = option_string[2:]
2143 for option_string in self._option_string_actions:
2144 if option_string == short_option_prefix:
2145 action = self._option_string_actions[option_string]
2146 tup = action, option_string, short_explicit_arg
2148 elif option_string.startswith(option_prefix):
2149 action = self._option_string_actions[option_string]
2150 tup = action, option_string, explicit_arg
2155 self.error(_('unexpected option string: %s') % option_string)