voxora serve returns exit 2 ("usage error") instead of a "not implemented" signal
- Linguagem predominante
- Rust
- Estrelas
- 0
- Forks
- 1
- Merge médio
- 11min
- PRs com merge (30d)
- 47
Descrição
## What
`voxora-cli/src/args/serve.rs:7-12` returns
`CliError::InvalidInput("`voxora serve` is not implemented yet;
…")`. Per `voxora-cli/src/error.rs:41-46`, `InvalidInput`
maps to exit code 2, which the Unix convention reserves for
command-line usage errors (per `sysexits.h(3)`). A missing
feature is not a usage error.
This conflates two failure modes and breaks shell pipelines that
key off `0 -eq 2` for argparse failures:
```sh
if ! voxora serve; then
case $? in
2) handle_cli_usage ;;
esac
fi
```
The `cli_help.rs:128-138` test explicitly asserts the current
exit 2 behaviour, which is why the asymmetry has lived since
0.1.0.
## Recipe
Add a dedicated `CliError::NotImplemented { feature: String }`
variant mapped to exit code 1 ("runtime failure"). Have
`voxora-cli/src/args/serve.rs` return it instead of
`InvalidInput`. Update the `cli_help.rs:128` test to assert
exit 1 (and the new variant's Display format).
Document the new exit-code mapping in
`voxora-cli/README.md` (or wherever the CLI's exit-code table
lives) so downstream consumers can update their pipelines.
## Acceptance
- `voxora serve` exits 1 with a "not implemented" message.
- `voxora run --bad-flag` still exits 2 (existing
`cli_help.rs` tests stay green for that case).
- The CLI's exit-code table is updated.
Guia de contribuição
Avaliação
Esta issue ainda não foi avaliada.