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

Method _install_help_function

cmd2/cmd2.py:997–1002  ·  view source on GitHub ↗
(self, cmd_name: str, cmd_help: Callable[..., None])

Source from the content-addressed store, hash-verified

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
999
1000 if hasattr(self, help_func_name):
1001 raise CommandSetRegistrationError(f"Attribute already exists: {help_func_name}")
1002 setattr(self, help_func_name, cmd_help)
1003
1004 def unregister_command_set(self, cmdset: CommandSet[Any]) -> None:
1005 """Uninstalls a CommandSet and unloads all associated commands.

Callers 2

register_command_setMethod · 0.95

Calls 1

Tested by 1