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

Method get_command

src/click/core.py:2089–2104  ·  view source on GitHub ↗
(self, ctx: Context, cmd_name: str)

Source from the content-addressed store, hash-verified

2087 self.sources.append(group)
2088
2089 def get_command(self, ctx: Context, cmd_name: str) -> Command | None:
2090 rv = super().get_command(ctx, cmd_name)
2091
2092 if rv is not None:
2093 return rv
2094
2095 for source in self.sources:
2096 rv = source.get_command(ctx, cmd_name)
2097
2098 if rv is not None:
2099 if self.chain:
2100 _check_nested_chain(self, cmd_name, rv)
2101
2102 return rv
2103
2104 return None
2105
2106 def list_commands(self, ctx: Context) -> list[str]:
2107 rv: set[str] = set(super().list_commands(ctx))

Callers

nothing calls this directly

Calls 2

_check_nested_chainFunction · 0.85
get_commandMethod · 0.45

Tested by

no test coverage detected