MCPcopy
hub / github.com/pallets/click / get_command

Method get_command

src/click/core.py:1875–1879  ·  view source on GitHub ↗

Given a context and a command name, this returns a :class:`Command` object if it exists or returns ``None``.

(self, ctx: Context, cmd_name: str)

Source from the content-addressed store, hash-verified

1873 return decorator
1874
1875 def get_command(self, ctx: Context, cmd_name: str) -> Command | None:
1876 """Given a context and a command name, this returns a :class:`Command`
1877 object if it exists or returns ``None``.
1878 """
1879 return self.commands.get(cmd_name)
1880
1881 def list_commands(self, ctx: Context) -> list[str]:
1882 """Returns a list of subcommand names in the order they should appear."""

Callers 5

to_info_dictMethod · 0.95
format_commandsMethod · 0.95
resolve_commandMethod · 0.95
get_commandMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected