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

Function _check_nested_chain

src/click/core.py:78–95  ·  view source on GitHub ↗
(
    base_command: Group, cmd_name: str, cmd: Command, register: bool = False
)

Source from the content-addressed store, hash-verified

76
77
78def _check_nested_chain(
79 base_command: Group, cmd_name: str, cmd: Command, register: bool = False
80) -> None:
81 if not base_command.chain or not isinstance(cmd, Group):
82 return
83
84 if register:
85 message = (
86 f"It is not possible to add the group {cmd_name!r} to another"
87 f" group {base_command.name!r} that is in chain mode."
88 )
89 else:
90 message = (
91 f"Found the group {cmd_name!r} as subcommand to another group "
92 f" {base_command.name!r} that is in chain mode. This is not supported."
93 )
94
95 raise RuntimeError(message)
96
97
98def _format_deprecated_label(deprecated: bool | str) -> str:

Callers 2

add_commandMethod · 0.85
get_commandMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…