()
| 251 | |
| 252 | |
| 253 | def create_help() -> tuple[str, list[str]]: |
| 254 | ctx = click.Context(scenedetect, info_name=scenedetect.name) |
| 255 | |
| 256 | commands: list[str] = ctx.command.list_commands(ctx) |
| 257 | commands = list( |
| 258 | filter(lambda command: not ctx.command.get_command(ctx, command).hidden, commands) |
| 259 | ) |
| 260 | # ctx.to_info_dict lacks metavar so we have to use the context directly. |
| 261 | actions = [ |
| 262 | generate_title("``scenedetect`` \N{CLAPPER BOARD} Command", level=0), |
| 263 | generate_command_help(ctx, ctx.command), |
| 264 | generate_subcommands(ctx, commands), |
| 265 | ] |
| 266 | lines = [] |
| 267 | for action in actions: |
| 268 | lines.extend(action) |
| 269 | return "".join(lines), commands |
| 270 | |
| 271 | |
| 272 | def main(): |
no test coverage detected