MCPcopy Create free account
hub / github.com/apache/madlib / add_argument

Method add_argument

src/madpack/argparse.py:282–298  ·  view source on GitHub ↗
(self, action)

Source from the content-addressed store, hash-verified

280 self._add_item(self._format_usage, args)
281
282 def add_argument(self, action):
283 if action.help is not SUPPRESS:
284
285 # find all invocations
286 get_invocation = self._format_action_invocation
287 invocations = [get_invocation(action)]
288 for subaction in self._iter_indented_subactions(action):
289 invocations.append(get_invocation(subaction))
290
291 # update the maximum item length
292 invocation_length = max([len(s) for s in invocations])
293 action_length = invocation_length + self._current_indent
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 3

add_argumentsMethod · 0.95
mainFunction · 0.45
__init__Method · 0.45

Calls 2

_add_itemMethod · 0.95

Tested by

no test coverage detected