MCPcopy Index your code
hub / github.com/Breakthrough/PySceneDetect / generate_subcommands

Function generate_subcommands

docs/generate_cli_docs.py:226–250  ·  view source on GitHub ↗
(ctx: click.Context, commands: list[str])

Source from the content-addressed store, hash-verified

224
225
226def 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
253def create_help() -> tuple[str, list[str]]:

Callers 1

create_helpFunction · 0.85

Calls 2

generate_titleFunction · 0.85
generate_command_helpFunction · 0.85

Tested by

no test coverage detected