Return a list of completions for the incomplete value. Looks at the names of options, subcommands, and chained multi-commands. :param ctx: Invocation context for this command. :param incomplete: Value being completed. May be empty. .. versionadded:: 8.0
(self, ctx: Context, incomplete: str)
| 2028 | return cmd_name if cmd else None, cmd, args[1:] |
| 2029 | |
| 2030 | def shell_complete(self, ctx: Context, incomplete: str) -> list[CompletionItem]: |
| 2031 | """Return a list of completions for the incomplete value. Looks |
| 2032 | at the names of options, subcommands, and chained |
| 2033 | multi-commands. |
| 2034 | |
| 2035 | :param ctx: Invocation context for this command. |
| 2036 | :param incomplete: Value being completed. May be empty. |
| 2037 | |
| 2038 | .. versionadded:: 8.0 |
| 2039 | """ |
| 2040 | from click.shell_completion import CompletionItem |
| 2041 | |
| 2042 | results = [ |
| 2043 | CompletionItem(name, help=command.get_short_help_str()) |
| 2044 | for name, command in _complete_visible_commands(ctx, incomplete) |
| 2045 | ] |
| 2046 | results.extend(super().shell_complete(ctx, incomplete)) |
| 2047 | return results |
| 2048 | |
| 2049 | |
| 2050 | class _MultiCommand(Group, metaclass=_FakeSubclassCheck): |
no test coverage detected