cli: publish the finite option vocabularies through clap #198

Merged
natsukium merged 2 commits from feat/finite-option-values-187 into main 2026-09-07 21:29:43 +09:00
Owner

Fixes #187.

--format and capture --source parsed their values by hand, so clap published no possible values into --help, __mangen, or the generated completions. Both vocabularies are now ValueEnums (human|json, human|jsonl, and the four region sources), so one declaration reaches every published surface, and a bad value is refused with the list of what the verb accepts. felis bridge still takes the source vocabulary as a JSON string, so parse_region_source stays as that wrapper.

Help text itself gained a test: an insta snapshot walks the visible command tree and renders render_long_help() for the root and every subcommand, so a reworded flag or a lost possible value is a reviewed diff. A completion test asserts the zsh script carries the --format and --source values.

Doc cascade: docs/reference/cli.md names the possible values where it describes --format and capture --source; CHANGELOG.md records the user-visible help/completion change.

Verified: just check green (fmt, clippy, nextest, deny, proto-compat); reviewed by pi luna + pi sol; docs proofread by Gemini gemini-3.8-flash-high

Deferred

  • The last acceptance criterion — evidencing #55's two remaining closure criteria and closing the tracker: explicitly post-merge work on tracker #55, not code in this PR.
Fixes #187. `--format` and `capture --source` parsed their values by hand, so clap published no possible values into `--help`, `__mangen`, or the generated completions. Both vocabularies are now `ValueEnum`s (`human|json`, `human|jsonl`, and the four region sources), so one declaration reaches every published surface, and a bad value is refused with the list of what the verb accepts. `felis bridge` still takes the source vocabulary as a JSON string, so `parse_region_source` stays as that wrapper. Help text itself gained a test: an insta snapshot walks the visible command tree and renders `render_long_help()` for the root and every subcommand, so a reworded flag or a lost possible value is a reviewed diff. A completion test asserts the zsh script carries the `--format` and `--source` values. Doc cascade: `docs/reference/cli.md` names the possible values where it describes `--format` and `capture --source`; `CHANGELOG.md` records the user-visible help/completion change. Verified: just check green (fmt, clippy, nextest, deny, proto-compat); reviewed by pi luna + pi sol; docs proofread by Gemini gemini-3.8-flash-high ## Deferred - The last acceptance criterion — evidencing #55's two remaining closure criteria and closing the tracker: explicitly post-merge work on tracker #55, not code in this PR.
`--format` and `capture --source` parsed their values by hand, so clap
knew nothing about them: `--help`, the man page, and the generated
completions carried no possible values, and `--source <TAB>` fell back
to filenames. Modeling them as `ValueEnum`s makes the one vocabulary
reach every published surface at once.

The refusal for a bad value changes with it: clap lists the values the
verb takes instead of naming the sibling framing. Listing what is
accepted is the more useful half, and it is the half a reader cannot
get anywhere else once the message is the only thing on screen.

`felis bridge` takes the same source vocabulary as a JSON string rather
than through clap, so `parse_region_source` stays as the wrapper that
spells that refusal out.

Refs #187
cli: snapshot every visible help page
Some checks failed
bench / Criterion full-suite snapshot (pull_request) Has been skipped
fuzz / cargo fuzz nightly long-run (pull_request) Has been skipped
fuzz / cargo fuzz smoke (per target) (pull_request) Successful in 1m10s
darwin / build felis (aarch64-darwin) (pull_request) Successful in 2m6s
bench / Criterion regression gate (pull_request) Failing after 2m8s
darwin / detect relevant changes (pull_request) Successful in 3s
darwin / darwin docs-only no-op (pull_request) Has been skipped
pr / nix flake check (pull_request) Successful in 1m11s
pr / cargo build / clippy / test / deny (pull_request) Successful in 1m38s
pr / wire schema is compatible with the base (pull_request) Successful in 11s
windows / cargo clippy (Windows cross) (pull_request) Successful in 14s
pr / frontend smoke (x86_64-linux) (pull_request) Successful in 3m29s
pr / publish felis (x86_64-linux) (pull_request) Has been skipped
windows / detect relevant changes (pull_request) Successful in 3s
windows / windows docs-only no-op (pull_request) Has been skipped
windows / cargo nextest (Windows) (pull_request) Successful in 5m50s
windows / frontend smoke (Windows) (pull_request) Successful in 1m58s
windows / package felis (x86_64-pc-windows-msvc) (pull_request) Has been skipped
9ccce4bc5d
Help text is a published surface with no test behind it: a reworded
flag, a lost possible value, or a verb that stopped documenting where
its globals go all landed silently. One insta snapshot over the walked
command tree turns any of those into a reviewed diff.

clap's generated `help` subcommand is skipped: it mirrors the same
pages one indirection out, tripling the snapshot without adding a
surface a reader can change.

Refs #187
natsukium deleted branch feat/finite-option-values-187 2026-09-07 21:29:43 +09:00
Sign in to join this conversation.
No description provided.