MCPcopy Index your code
hub / github.com/RustPython/RustPython / add_argument

Method add_argument

Lib/argparse.py:280–295  ·  view source on GitHub ↗
(self, action)

Source from the content-addressed store, hash-verified

278 self._add_item(self._format_usage, args)
279
280 def add_argument(self, action):
281 if action.help is not SUPPRESS:
282
283 # find all invocations
284 get_invocation = lambda x: self._decolor(self._format_action_invocation(x))
285 invocation_lengths = [len(get_invocation(action)) + self._current_indent]
286 for subaction in self._iter_indented_subactions(action):
287 invocation_lengths.append(len(get_invocation(subaction)) + self._current_indent)
288
289 # update the maximum item length
290 action_length = max(invocation_lengths)
291 self._action_max_length = max(self._action_max_length,
292 action_length)
293
294 # add the item to the list
295 self._add_item(self._format_action, [action])
296
297 def add_arguments(self, actions):
298 for action in actions:

Callers 15

add_argumentsMethod · 0.95
wdriverFunction · 0.45
mainFunction · 0.45
mainFunction · 0.45
pickletools.pyFile · 0.45
parse_argsFunction · 0.45
mainFunction · 0.45
_mainFunction · 0.45
mainFunction · 0.45
_testFunction · 0.45
code.pyFile · 0.45
mainFunction · 0.45

Calls 6

_add_itemMethod · 0.95
lenFunction · 0.85
maxFunction · 0.85
appendMethod · 0.45

Tested by 15

wdriverFunction · 0.36
_testFunction · 0.36
no_groupsMethod · 0.36
one_groupMethod · 0.36
many_groupsMethod · 0.36
test_constMethod · 0.36
test_invalid_nameMethod · 0.36
test_parse_enum_valueMethod · 0.36
testMethod · 0.36
testMethod · 0.36