Commit 616d441
Tighten
Three small UX fixes surfaced by manual exercise of the subcommand.
* `gix licenses -h` was rendering the entire `--verbose` no-op
documentation inline because the doc-comment was a single paragraph.
clap-derive treats the first paragraph as the short-help text and
any subsequent paragraphs as the long-help-only details. Split the
`--verbose` doc-comment so `-h` shows just "In the default summary
view, also list workspace members whose license and authorship
match the root `gitoxide` package's" and the no-op caveat block
appears only under `--help`. Same shape applied to the `crate_name`
positional argument's doc-comment so its `-h` line is the
one-sentence summary, not the full "May be a third-party
dependency, a workspace member with separate attribution, or a
workspace member whose license and authorship match …" detail.
* The unknown-crate error wording diverged between the human and
JSON output paths — the human path used `{name:?}`-style
`"name"` quoting from `render::render_crate`, while the JSON
path used backtick quoting from `emit_single_crate_json_against`'s
`anyhow::bail!`. A user flipping `--format` between the two saw
inconsistent inner phrasing for the same condition. Unify on
backticks (matching the rest of the subcommand's error wording).
Add a regression test (`unknown_crate_error_uses_backtick_form_in_both_paths`)
that checks both paths against the same backticked-name substring,
so a future drift between them surfaces here.
Test counts after this commit:
* `cargo test --features max-pure --test licenses_cli` — 27 (was 26).
* Other counts unchanged.
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>licenses --help shape and unify the unknown-crate error wording1 parent 27e3750 commit 616d441
3 files changed
Lines changed: 36 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
384 | 384 | | |
385 | 385 | | |
386 | 386 | | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
387 | 391 | | |
388 | 392 | | |
389 | | - | |
| 393 | + | |
390 | 394 | | |
391 | 395 | | |
392 | 396 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
| 28 | + | |
28 | 29 | | |
29 | 30 | | |
30 | 31 | | |
| |||
49 | 50 | | |
50 | 51 | | |
51 | 52 | | |
52 | | - | |
53 | | - | |
54 | | - | |
55 | | - | |
56 | | - | |
57 | | - | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
58 | 60 | | |
59 | 61 | | |
60 | 62 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
377 | 377 | | |
378 | 378 | | |
379 | 379 | | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
380 | 403 | | |
381 | 404 | | |
382 | 405 | | |
| |||
0 commit comments