feat(cli): add --transcript option

This commit is contained in:
2026-09-04 23:34:12 +02:00
parent cedff5b932
commit 7591614460
4 changed files with 61 additions and 2 deletions
+16 -1
View File
@@ -100,6 +100,11 @@ def main(argv: list[str] | None = None) -> int:
default=100,
help="max rounds per battle (default: 100)",
)
parser.add_argument(
"--transcript",
action="store_true",
help="print the turn-by-turn log of the first battle before the report",
)
args = parser.parse_args(argv)
if not args.side:
parser.error("at least one --side is required")
@@ -113,9 +118,19 @@ def main(argv: list[str] | None = None) -> int:
return 2
try:
registry = load_spell_registry(SPELLS_DIR)
report = run_encounter(spec, runs=args.runs, seed=args.seed, spell_registry=registry)
report = run_encounter(
spec,
runs=args.runs,
seed=args.seed,
spell_registry=registry,
capture_first_transcript=args.transcript,
)
except ValueError as exc:
print(f"pf1e-sim: {exc}", file=sys.stderr)
return 2
if args.transcript and report.transcript is not None:
print("=== Déroulé du premier combat ===")
print("\n".join(report.transcript))
print()
print(format_report(report, spec))
return 0