MCPcopy Index your code
hub / github.com/python-cmd2/cmd2 / _install_completer_function

Method _install_completer_function

cmd2/cmd2.py:990–995  ·  view source on GitHub ↗
(self, cmd_name: str, cmd_completer: BoundCompleter)

Source from the content-addressed store, hash-verified

988 setattr(self, command_func_name, command_method)
989
990 def _install_completer_function(self, cmd_name: str, cmd_completer: BoundCompleter) -> None:
991 completer_func_name = COMPLETER_FUNC_PREFIX + cmd_name
992
993 if hasattr(self, completer_func_name):
994 raise CommandSetRegistrationError(f"Attribute already exists: {completer_func_name}")
995 setattr(self, completer_func_name, cmd_completer)
996
997 def _install_help_function(self, cmd_name: str, cmd_help: Callable[..., None]) -> None:
998 help_func_name = HELP_FUNC_PREFIX + cmd_name

Callers 2

register_command_setMethod · 0.95

Calls 1

Tested by 1