MCPcopy Index your code
hub / github.com/python/cpython / add_argument

Method add_argument

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

Source from the content-addressed store, hash-verified

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

Callers 15

add_argumentsMethod · 0.95
mainFunction · 0.45
mainFunction · 0.45
mainFunction · 0.45
mainFunction · 0.45
mainFunction · 0.45
add_parserFunction · 0.45
parse_argsFunction · 0.45
parse_argsFunction · 0.45
mainFunction · 0.45
wasm_assets.pyFile · 0.45

Calls 4

_add_itemMethod · 0.95
appendMethod · 0.45

Tested by 15

_testFunction · 0.36
test_pickle_roundtripMethod · 0.36
no_groupsMethod · 0.36
one_groupMethod · 0.36
many_groupsMethod · 0.36
test_constMethod · 0.36
test_invalid_nameMethod · 0.36
test_invalid_nameMethod · 0.36
test_invalid_nameMethod · 0.36
test_invalid_nameMethod · 0.36
test_parse_enum_valueMethod · 0.36