MCPcopy Create free account
hub / github.com/commitizen-tools/commitizen / gen_cli_help_screenshots

Function gen_cli_help_screenshots

scripts/gen_cli_help_screenshots.py:11–24  ·  view source on GitHub ↗

Generate the screenshot for help message on each cli command and save them as svg files.

()

Source from the content-addressed store, hash-verified

9
10
11def gen_cli_help_screenshots() -> None:
12 """Generate the screenshot for help message on each cli command and save them as svg files."""
13 images_root = Path(__file__).parent.parent / "docs" / "images" / "cli_help"
14 images_root.mkdir(parents=True, exist_ok=True)
15
16 cz_commands = (
17 command["name"] if isinstance(command["name"], str) else command["name"][0]
18 for command in data["subcommands"]["commands"] # type: ignore[index]
19 )
20 for cmd in chain(
21 ["cz --help"], (f"cz {cz_command} --help" for cz_command in cz_commands)
22 ):
23 file_name = f"{cmd.replace(' ', '_').replace('-', '_')}.svg"
24 _export_cmd_as_svg(cmd, images_root / file_name)
25
26
27def _export_cmd_as_svg(cmd: str, file_path: Path) -> None:

Callers 1

Calls 1

_export_cmd_as_svgFunction · 0.85

Tested by

no test coverage detected