Parents: #491, #493 Related: #617
Problem
The Test262 runner fell through to the full default corpus for every unrecognized first argument. A harmless-looking test262 --help therefore launched the complete parent driver and worker tree. Recognized modes with missing operands silently returned success. This could create long-lived hidden corpus work, contaminate evidence jobs, and turn CLI mistakes into expensive host load.
This was observed directly while validating #618/#619: an attempted --help probe spawned a class-expression subtree driver, remained alive after the calling tool returned, and invalidated an otherwise complete parent/candidate comparison.
Scope
- Preserve no-argument execution as the intentional full-corpus entry point used by
zig build test262. - Add explicit
--helpusage output that exits successfully without opening the corpus or spawning workers. - Reject unknown options/modes before
runParent. - Reject missing required operands and malformed numeric worker ranges with a nonzero result instead of silently returning or coercing to zero.
- Reject unexpected trailing operands for fixed-arity modes; retain the documented optional
--diagfilter and variadic--vm-witnesspaths. - Add deterministic argument-contract tests that do not execute Test262.
No-workaround rules
- No argument allowlist in a shell wrapper, delayed validation after corpus discovery, silent success, worker spawning for usage output, or weakening the intentional no-argument full run.
Acceptance
- No args retains the exact full-corpus dispatch to
runParent. --helpis side-effect-free and documents every mode.- Unknown, incomplete, malformed, and over-complete fixed-arity invocations fail before corpus work.
--diagoptional filtering and--vm-witnessvariadic paths remain exact in the command contract.- Focused CLI tests, valid-path Test262 smoke, and dependency/build gates pass; 0 Test262 semantic flips.