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

Method get_command_func

cmd2/cmd2.py:3335–3343  ·  view source on GitHub ↗

Get the bound command function for a command. :param command: the name of the command :return: the bound function implementing the command, or None if not found

(self, command: str)

Source from the content-addressed store, hash-verified

3333 self._redirecting = saved_redir_state.saved_redirecting
3334
3335 def get_command_func(self, command: str) -> BoundCommandFunc | None:
3336 """Get the bound command function for a command.
3337
3338 :param command: the name of the command
3339 :return: the bound function implementing the command, or None if not found
3340 """
3341 command_func_name = constants.COMMAND_FUNC_PREFIX + command
3342 command_func = getattr(self, command_func_name, None)
3343 return cast(BoundCommandFunc, command_func) if callable(command_func) else None
3344
3345 def _get_command_category(self, func: BoundCommandFunc) -> str:
3346 """Determine the category for a command.

Callers 13

_perform_completionMethod · 0.95
onecmdMethod · 0.95
_build_command_infoMethod · 0.95
do_helpMethod · 0.95
disable_commandMethod · 0.95
disable_categoryMethod · 0.95
abbrev_hookMethod · 0.80

Calls

no outgoing calls

Tested by 1