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

Function _complete_visible_commands

src/click/core.py:59–75  ·  view source on GitHub ↗

List all the subcommands of a group that start with the incomplete value and aren't hidden. :param ctx: Invocation context for the group. :param incomplete: Value being completed. May be empty.

(
    ctx: Context, incomplete: str
)

Source from the content-addressed store, hash-verified

57
58
59def _complete_visible_commands(
60 ctx: Context, incomplete: str
61) -> cabc.Iterator[tuple[str, Command]]:
62 """List all the subcommands of a group that start with the
63 incomplete value and aren't hidden.
64
65 :param ctx: Invocation context for the group.
66 :param incomplete: Value being completed. May be empty.
67 """
68 multi = t.cast(Group, ctx.command)
69
70 for name in multi.list_commands(ctx):
71 if name.startswith(incomplete):
72 command = multi.get_command(ctx, name)
73
74 if command is not None and not command.hidden:
75 yield name, command
76
77
78def _check_nested_chain(

Callers 2

shell_completeMethod · 0.85
shell_completeMethod · 0.85

Calls 2

list_commandsMethod · 0.45
get_commandMethod · 0.45

Tested by

no test coverage detected