MCPcopy
hub / github.com/tanelpoder/0xtools / add_argument

Method add_argument

lib/0xtools/argparse.py:275–291  ·  view source on GitHub ↗
(self, action)

Source from the content-addressed store, hash-verified

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

Callers 3

add_argumentsMethod · 0.95
__init__Method · 0.45
mainFunction · 0.45

Calls 2

_add_itemMethod · 0.95

Tested by 1

mainFunction · 0.36