main.rs split into args/walk/diff modules, all std-only. --diff emits
a patch-applicable unified diff (bounded-resync hunks, GNU-style
missing-newline marker); --exclude is a small component-glob matcher
that prunes directory walks; --stdin-filename names stdin buffers in
messages; per-file catch_unwind turns formatter panics into ordinary
errors. Exit-code contract (0/1/2) frozen and documented in --help
and README. 12 CLI integration tests + 18 unit tests.
Known gap found by QA, queued in TODO §1: deep nesting overflows the
parser stack (uncatchable), needs an explicit recursion-depth limit.
Dev: Opus agent; QA: Sonnet agent; review in
docs/features/cli-polish/README.md (includes one lead fix: the
no-final-newline marker is now emitted the way patch(1) expects).
Co-Authored-By: Claude Fable 5 <[email protected]>