Confirms the --check subcommand (src/check.rs) is fully implemented: openpty probe, mkfifo probe, optional mock_claude PTY round-trip, exits 0 on success with diagnostic table, exits 2 on any FAIL. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1.3 KiB
1.3 KiB
bf-360: --check subcommand verification
Task
Implement --check subcommand in claude-print.
Status
Already implemented in commit 50b2132 (Phase 9: NEEDLE integration).
Verification
Ran ./target/debug/claude-print --check on this system:
CHECK RESULT DETAIL
------------------------------------------------------------------------
openpty PASS openpty() syscall succeeded
mkfifo PASS mkfifo succeeded (dir: /home/coding/.tmp)
mock_claude PTY PASS PTY round-trip OK — isatty=true in child (/home/coding/.local/bin/mock_claude)
All checks passed.
Exit code: 0
Implementation
src/check.rs—run()function with three probes:probe_openpty(): callsopenpty(None, None), drops handles, returns PASS/FAILprobe_mkfifo(): creates a named FIFO in$TMPDIR, cleans up, returns PASS/FAILprobe_mock_claude_pty(): optional; forks, execsmock_claudein a PTY slave vialogin_tty, waits up to 5s for exit 0
src/cli.rs—--checkflag wired intoClistructsrc/main.rs—if cli.check { let code = claude_print::check::run(); process::exit(code); }src/lib.rs—pub mod check;exported
All acceptance criteria met: cargo build succeeds, --check exits 0 with diagnostic table, missing openpty would exit 2 with FAIL row.