feat(cli): define and enforce exit-code policy#34
Conversation
Introduce CliExitCode enum (0 success, 1 outcome failure, 2 usage error) and route parser and command handlers through it. - Classify adr new missing title and extra args as usage errors (exit 2) - Parse adr check --format via clap value_parser - Add exit_code_command integration tests - Document policy in README and OpenSpec specs Closes #15 Co-authored-by: Grig Alex <alexengrigdev@gmail.com>
alexengrig
left a comment
There was a problem hiding this comment.
@cursor Thanks, this is close and matches the #15 policy direction well. One blocking issue remains: CI is failing in the clippy step, and the unused CheckOutputFormat import in main.rs appears to be the cause after run_check moved format parsing into cli.rs.
Please remove that unused import and rerun the checks.
|
Fixed the CI clippy failure and pushed to PR #34. Changes:
Checks passed:
|
Move default format resolution into CheckArgs::output_format() in cli.rs and allow dead_code on shared test support helpers used selectively. Co-authored-by: Grig Alex <alexengrigdev@gmail.com>
alexengrig
left a comment
There was a problem hiding this comment.
Changes look good now. The previous unused import issue is fixed, the review thread is resolved, CI is green, and the exit-code policy implementation matches #15.
|
Bugbot is not enabled for your account, so this pull request was not reviewed. Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs. |


Summary
Implements #15 by defining and enforcing a consistent CLI exit-code policy:
012Changes
CliExitCodeenum and named constants incrates/adrman-cli/src/exit_code.rsadr newmissing title and extra title tokens as usage errors (2)adr check --formatwith clapvalue_parserso unsupported values are usage errorsexit_code_commandintegration tests covering representative0/1/2casescli-root,cli-new)Testing
cargo test --workspacecargo clippy --workspace --all-targetscargo fmt --checkCloses #15