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
)
| 57 | |
| 58 | |
| 59 | def _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 | |
| 78 | def _check_nested_chain( |
no test coverage detected