docs(clew): move command details into help

This commit is contained in:
2026-09-07 14:12:11 -04:00
parent 311030279f
commit e99269bb48
2 changed files with 25 additions and 52 deletions

View File

@@ -1,6 +1,7 @@
from __future__ import annotations
import argparse
import textwrap
import logging
import os
import shutil
@@ -16,7 +17,26 @@ MANAGED_DIRS = ("source", "work", "logs")
def parse_args(argv: list[str]) -> argparse.Namespace:
parser = argparse.ArgumentParser(
prog="clew",
description="Prepare Ren'Py game artifacts for Ariadne.",
description="Extract Ren'Py game files for Ariadne.",
formatter_class=argparse.RawDescriptionHelpFormatter,
epilog=textwrap.dedent(
"""\
output layout:
output/
source/ copied loose and archived .rpy source files
work/ extracted archives and copied compiled scripts
logs/ run logs
behavior:
Clew copies loose .rpy files into source/.
Clew copies loose .rpyc and .rpymc files into work/compiled/.
Clew extracts each .rpa archive into work/archives/.
Clew copies extracted .rpy files into source/.
Clew skips files under Ren'Py runtime directories.
Without --force, Clew refuses to reuse managed output dirs.
With --force, Clew deletes only source/, work/, and logs/.
"""
),
)
parser.add_argument(
"--game-root",
@@ -28,7 +48,7 @@ def parse_args(argv: list[str]) -> argparse.Namespace:
"--output-root",
type=Path,
default=default_output_root(),
help="Preparation output root.",
help="Preparation output root. Defaults to repository output/.",
)
parser.add_argument(
"--force",
@@ -38,7 +58,7 @@ def parse_args(argv: list[str]) -> argparse.Namespace:
parser.add_argument(
"--suffix",
action="append",
help="Extract only archive paths with this suffix.",
help="Extract only archive paths with this suffix. Repeatable.",
)
return parser.parse_args(argv)