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

Method _print_invalid_arg

Lib/pdb.py:2635–2648  ·  view source on GitHub ↗

Return the usage string for a function.

(self, arg)

Source from the content-addressed store, hash-verified

2633 return "\n".join(formatted)
2634
2635 def _print_invalid_arg(self, arg):
2636 """Return the usage string for a function."""
2637
2638 if not arg:
2639 self.error("Argument is required for this command")
2640 else:
2641 self.error(f"Invalid argument: {arg}")
2642
2643 # Yes it's a bit hacky. Get the caller name, get the method based on
2644 # that name, and get the docstring from that method.
2645 # This should NOT fail if the caller is a method of this class.
2646 doc = inspect.getdoc(getattr(self, sys._getframe(1).f_code.co_name))
2647 if doc is not None:
2648 self.message(self._help_message_from_doc(doc, usage_only=True))
2649
2650# Collect all command help into docstring, if not run with -OO
2651

Callers 15

do_commandsMethod · 0.95
do_enableMethod · 0.95
do_disableMethod · 0.95
do_conditionMethod · 0.95
do_ignoreMethod · 0.95
do_stepMethod · 0.95
do_nextMethod · 0.95
do_returnMethod · 0.95
do_continueMethod · 0.95
do_jumpMethod · 0.95
do_debugMethod · 0.95
do_argsMethod · 0.95

Calls 3

errorMethod · 0.95
messageMethod · 0.95

Tested by

no test coverage detected