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)