From fc0cb8c7c54753da749bd74d6ae0f153f99cafc5 Mon Sep 17 00:00:00 2001 From: Jeremy Siek Date: Fri, 20 Nov 2026 08:45:08 -0500 Subject: [PATCH] Read `--verbose full`'s level without checking `full` as a file (#1302) The `--verbose` branch set the FULL level when the next argument was `full`, but didn't skip it, so `full` was also taken as a file to check and deduce.py stopped with "full was not found!". The CLI sanity check in test-deduce.py now also runs `--verbose full`. Closes #1302 Co-Authored-By: Claude Opus 5.5 --- deduce.py | 1 + test-deduce.py | 11 +++++++++++ 2 files changed, 12 insertions(+) diff --git a/deduce.py b/deduce.py index 32000821..ddabff65 100644 --- a/deduce.py +++ b/deduce.py @@ -242,6 +242,7 @@ def check_in_prelude(deducable : str, stdlib_dir : str) -> bool: if i + 1 < len(sys.argv) and sys.argv[i+1] == 'full': set_verbose(VerboseLevel.FULL) set_unique_names(True) + already_processed_next = True else: set_verbose(VerboseLevel.CURR_ONLY) elif argument == '--dir' and i + 1 < len(sys.argv): diff --git a/test-deduce.py b/test-deduce.py index 537693c9..7f2e37b4 100644 --- a/test-deduce.py +++ b/test-deduce.py @@ -1564,6 +1564,17 @@ def run_cli_test() -> list[tuple[str, str, str]]: cli_path, "cli", f"unexpected stdout:\n{cp.stdout[:500]}", )) + # `--verbose full` takes `full` as its level, not as a file (#1302). + verbose_cp = subprocess.run( + [sys.executable, "deduce.py", "--no-stdlib", "--verbose", "full", cli_path], + capture_output=True, text=True, + ) + if verbose_cp.returncode != 0 or "theorem_true.pf is valid" not in verbose_cp.stdout: + failures.append(( + "deduce.py --verbose full", "cli", + f"exit {verbose_cp.returncode}\nstderr: {verbose_cp.stderr[:500]}\n" + f"stdout: {verbose_cp.stdout[-500:]}", + )) help_cp = subprocess.run( [sys.executable, "deduce.py", "--help"], capture_output=True, text=True,