Repository navigation
fix(cli): reject zero, negative and reversed numeric arguments - #654
Conversation
clap treated `-1` as an unknown flag, so negative values failed with a confusing parse error. Value-taking args now accept negative numbers as values, and validation rejects them with a clear message: --limit, --start-line and --end-line must be positive, `file read` rejects start-line > end-line (matching agent-review), --workspace must be a positive id, and agent-review line numbers must be positive. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MxqTt1WtVRKkjNXQpgkJS9
…umeric-args # Conflicts: # src-tauri/src/cli/tests.rs
Ziinc
left a comment
There was a problem hiding this comment.
Review at ea5e8a47: Reviewed negative-number parsing, positive ID/limit/line validation, reversed line ranges, and the parser regression tests. No actionable correctness or code-quality issues found in this diff.
Validation: static review of the diff, surrounding implementation and tests; PR-head CI reports success. Rust/integration tests were not rerun locally because this environment has no Cargo toolchain.
…line `treq file read --start-line 301` without `--end-line` used the absolute default end of line 300, read 301..300 and returned no lines with exit 0, so an agent paging a long file stopped as if it had reached EOF. The default end is now start-line + 299. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01E1poGWXMSFcPsJ8V5gujWG
Keep both test modules in cli/tests.rs and this PR's --end-line description. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MxqTt1WtVRKkjNXQpgkJS9
…mmit test CreateCommit returns its error as a JSON envelope on stdout, so a losing process now fails with "nothing to commit" there rather than on stderr. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MxqTt1WtVRKkjNXQpgkJS9
|
CI: Generated by Claude Code |
-1as an unknown flag. Value-taking args now accept negative numbers as values, so validation rejects them as non-positive.--limit 0,--start-line 0/--end-line 0,file readwith start > end, and--workspace<= 0 are nowinvalid_arguments(matchingagent-review).file read --start-line Nwithout--end-linereads N..N+299; it used to read N..300, which returned nothing and looked like EOF.🤖 Generated with Claude Code
https://claude.ai/code/session_01MxqTt1WtVRKkjNXQpgkJS9
Generated by Claude Code
Generated by Claude Code