From 24a7c2783f3024609d09590d3baeaeca8b893245 Mon Sep 17 00:00:00 2001 From: alexion Date: Mon, 7 Sep 2026 14:40:45 -0400 Subject: [PATCH] refactor(clew): rename force flag to overwrite --- src/clew/clew.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/clew/clew.py b/src/clew/clew.py index b11cc2a..b0dcd1a 100644 --- a/src/clew/clew.py +++ b/src/clew/clew.py @@ -31,7 +31,7 @@ def parse_args(argv: list[str]) -> argparse.Namespace: help="Output root. Defaults to repository output/.", ) parser.add_argument( - "--force", + "--overwrite", action="store_true", help="Replace Clew-managed output directories.", ) @@ -54,13 +54,13 @@ def resolve_output_root(output_root: Path) -> Path: return output_root.resolve() -def prepare_output(output_root: Path, force: bool) -> tuple[Path, Path]: +def prepare_output(output_root: Path, overwrite: bool) -> tuple[Path, Path]: for name in MANAGED_DIRS: path = output_root / name - if path.exists() and not force: + if path.exists() and not overwrite: raise SystemExit(f"clew: refusing to overwrite existing output path: {path}") - if force: + if overwrite: for name in MANAGED_DIRS: shutil.rmtree(output_root / name, ignore_errors=True) @@ -135,7 +135,7 @@ def run(args: argparse.Namespace) -> None: raise SystemExit(f"clew: game root is not a directory: {game_root}") suffixes = normalize_suffixes(args.suffix) - extracted_dir, logs_dir = prepare_output(output_root, args.force) + extracted_dir, logs_dir = prepare_output(output_root, args.overwrite) configure_logging(logs_dir) LOGGER.info("copying loose files")