fix: make every script pass the --help gate AGENTS.md documents #6
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/help-gate"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
AGENTS.mdtells contributors to verify a change with:Three scripts have never passed it. Each crashed with a traceback rather than
printing usage:
pickthumb.pyIndexErroron a missingsys.argv[2]probe_mkv.py--helptoffprobe, then failed to parse the empty resultscan_titles.py--helpas a log fileEach now prints its docstring and exits 0 for
-h/--help, and gives aone-line usage message for a wrong argument count — the same shape
scan_streams.pyalready uses.scan_titles.pyandprobe_mkv.pyhad no docstring at all, so they get aone-line description of the question they answer, which is what
--helpnowprints.
Verification
Behaviour with correct arguments is unchanged, and all three were re-run
against real media to confirm rather than assumed:
scan_titles.pyon a live scan log — title table renders as beforeprobe_mkv.pyon an episode — stream list with names and flags intactpickthumb.pyon an extra — picked a frame, wrote a 49 KB JPEG, reportedwindow 55-75% Y=121 dev=170 sat=26 okUsage errors still read clearly:
The gate now passes on all 9 scripts.
AGENTS.md tells contributors to verify a change with for f in lib/*.py; do python3 "$f" --help >/dev/null || echo "FAILED $f"; done but three scripts have never passed it. Each crashed with a traceback instead of printing usage: pickthumb.py on a missing sys.argv[2], probe_mkv.py by handing '--help' to ffprobe and failing to parse the empty result, and scan_titles.py by trying to open '--help' as a log file. Each now prints its docstring and exits 0 for -h/--help, and gives a one-line usage message for a wrong argument count. scan_titles.py and probe_mkv.py had no docstring at all, so they get a one-line description of what they answer -- which is what --help now prints. Behaviour with correct arguments is unchanged; all three were re-run against real media to confirm it.