(self, ctx: click.Context, cmd_name: str)
| 9 | |
| 10 | class AliasedGroup(click.Group): |
| 11 | def get_command(self, ctx: click.Context, cmd_name: str) -> click.Command | None: |
| 12 | rv = click.Group.get_command(self, ctx, cmd_name) |
| 13 | if rv is not None: |
| 14 | return rv |
| 15 | matches = [x for x in self.list_commands(ctx) if x.startswith(cmd_name)] |
| 16 | if not matches: |
| 17 | return None |
| 18 | elif len(matches) == 1: |
| 19 | return click.Group.get_command(self, ctx, matches[0]) |
| 20 | ctx.fail(f"Too many matches: {', '.join(sorted(matches))}") |
| 21 | |
| 22 | def resolve_command( |
| 23 | self, ctx: click.Context, args: list[str] |
nothing calls this directly
no test coverage detected