From eec22bc251ca091b4f2433cce2c7de3fdd23709d Mon Sep 17 00:00:00 2001 From: Mizev Andrew <150728785+carpalsgrabby@users.noreply.github.com> Date: Tue, 25 Nov 2025 10:01:09 +0100 Subject: [PATCH] Add --dry-run flag Lets you preview the app.py commands without running them. --- choose_best_layout.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/choose_best_layout.py b/choose_best_layout.py index 8ac4dc2..b9af60c 100644 --- a/choose_best_layout.py +++ b/choose_best_layout.py @@ -42,6 +42,12 @@ def parse_args() -> argparse.Namespace: required=True, help="Commitment style to use.", ) + p.add_argument( + "--dry-run", + action="store_true", + help="Print commands but do not execute app.py." +) + p.add_argument( "--fanouts", nargs="+", @@ -118,7 +124,12 @@ def main() -> None: for f in args.fanouts: try: - data = run_app(app_path, args.leaves, args.style, f) + if args.dry_run: + print("DRY RUN >", f"fanout={f} leaves={args.leaves} style={args.style}") + continue + +data = run_app(app_path, args.leaves, args.style, f, print_cmd=args.print_cmd) + layouts.append(LayoutResult(fanout=f, data=data)) except Exception as e: # noqa: BLE001 print(f"ERROR for fanout={f}: {e}", file=sys.stderr)