(ctx: click.Context, commands: list[str])
| 224 | |
| 225 | |
| 226 | def generate_subcommands(ctx: click.Context, commands: list[str]) -> StrGenerator: |
| 227 | processed = set() |
| 228 | |
| 229 | for info_command in INFO_COMMANDS: |
| 230 | assert info_command in commands |
| 231 | processed.add(info_command) |
| 232 | yield INFO_COMMAND_OVERRIDE |
| 233 | |
| 234 | yield from generate_title("Detectors", 0) |
| 235 | detectors = [command for command in commands if command.startswith("detect-")] |
| 236 | for detector in detectors: |
| 237 | yield from generate_command_help(ctx, ctx.command.get_command(ctx, detector), ctx.info_name) |
| 238 | processed.add(detector) |
| 239 | |
| 240 | yield from generate_title("Commands", 0) |
| 241 | output_commands = [ |
| 242 | command |
| 243 | for command in commands |
| 244 | if (not command.startswith("detect-") and command not in INFO_COMMANDS) |
| 245 | ] |
| 246 | for command in output_commands: |
| 247 | yield from generate_command_help(ctx, ctx.command.get_command(ctx, command), ctx.info_name) |
| 248 | processed.add(command) |
| 249 | |
| 250 | assert set(commands) == processed |
| 251 | |
| 252 | |
| 253 | def create_help() -> tuple[str, list[str]]: |
no test coverage detected