Skip to content

fix(cli): wrap doc comments so -h help stays one line per flag#478

Merged
jdx merged 1 commit intomainfrom
fix/cli-help-line-wrapping
May 2, 2026
Merged

fix(cli): wrap doc comments so -h help stays one line per flag#478
jdx merged 1 commit intomainfrom
fix/cli-help-line-wrapping

Conversation

@jdx
Copy link
Copy Markdown
Contributor

@jdx jdx commented May 2, 2026

Summary

clap merges multi-line /// doc comments into one paragraph for short help (-h) and only splits on the first blank /// line to produce a separate first-line summary. Several flags across the CLI were written as one continuous paragraph, so aube <cmd> -h rendered them as 120+ char lines that wrapped awkwardly on standard terminals.

This PR splits each offender's doc comment into a short summary line + blank /// separator + the longer prose — same shape update --latest already uses (precedent: #473).

Flags fixed

  • add -g, --global, --no-save, --save-catalog, --save-catalog-name, -w, --workspace
  • approve-builds [PKG]... (positional doc), plus the subcommand summary on aube --help
  • audit --ignore-unfixable
  • check subcommand summary on aube --help
  • clean -l, --lockfile (also reflects to purge)
  • config list --all, --json
  • dlx -c, --shell-mode
  • find-hash --json
  • init --init-package-manager
  • install --fix-lockfile, --force, --lockfile-dir, --merge-git-branch-lockfiles, --resolution-mode, --verify-store-integrity
  • link -g, --global
  • list --long
  • patch --ignore-existing
  • patch-remove [PACKAGES]...
  • publish --force, --ignore-scripts, --json
  • query <SELECTOR>
  • remove -w, --workspace
  • run --parallel
  • store status subcommand summary
  • update -L, --latest (same fix as feat(cli): warn when aube update --depth is set #473, included here since that PR is still open)
  • version [NEW_VERSION]
  • view <PACKAGE>, [FIELD]

Validation

  • cargo build --workspace — clean
  • cargo clippy --all-targets -- -D warnings — clean
  • cargo fmt --check — clean
  • Audit before/after: lines >120 chars went from 6 to 0; lines >115 from 1 to 0
  • Sample audit script: for cmd in $(aube --help | grep -E '^ [a-z]' | awk '{print $1}'); do aube "$cmd" -h 2>&1 | awk 'length > 120'; done | grep -vE '\[possible values:|\[aliases:'

CLI docs regenerated via mise run render (aube.usage.kdl, docs/cli/commands.json, docs/cli/*.md).

Test plan

  • cargo build --workspace
  • cargo clippy --all-targets -- -D warnings
  • cargo fmt --check
  • Re-ran aube <cmd> -h for every fixed subcommand to confirm short help is now one clean summary line and aube <cmd> --help still shows the full prose

🤖 Generated with Claude Code


Note

Low Risk
Pure CLI help-text/doc updates plus regenerated docs/command metadata; no behavior or parsing logic changes, so risk is low aside from potential wording/regeneration drift.

Overview
Tightens CLI -h output by splitting many commands/flags’ descriptions into a short first-line summary plus separate long help, avoiding overly long wrapped lines in terminal help.

Updates the usage spec (aube.usage.kdl), clap doc comments across multiple command arg structs, and regenerates the derived CLI docs (docs/cli/*.md) and docs/cli/commands.json to reflect the new short/long help text (including approve-builds, check, publish, install, run, etc.).

Reviewed by Cursor Bugbot for commit 3e243a3. Bugbot is set up for automated code reviews on this repo. Configure here.

clap merges multi-line `///` doc comments into one paragraph for short
help (`-h`) and only splits on the first blank `///` line to produce a
separate first-line summary. Several flags were written as one
continuous paragraph, so `aube <cmd> -h` rendered them as 120+ char
lines that wrapped awkwardly on standard terminals.

Move the qualifier prose into a second paragraph so the short-help
line stays a concise summary — same shape `update --latest` uses (PR
#473).

Flags fixed across `add`, `approve-builds`, `audit`, `clean`, `config
list`, `dlx`, `find-hash`, `init`, `install`, `link`, `list`, `patch`,
`patch-remove`, `publish`, `query`, `remove`, `run`, `store status`,
`update`, `version`, `view`, plus the `ApproveBuilds` and `Check`
subcommand summaries on the top-level `aube --help`.

Regenerated `aube.usage.kdl` and `docs/cli/*` via `mise run render`.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@greptile-apps
Copy link
Copy Markdown

greptile-apps Bot commented May 2, 2026

Greptile Summary

This PR reformats multi-line doc comments across 22 source files so that clap renders a short, one-line summary for -h while preserving full prose for --help. Every changed flag gets a single-sentence summary line, a blank /// separator, and the detailed explanation in the long-help block. The generated docs (aube.usage.kdl, docs/cli/*.md, docs/cli/commands.json) are regenerated consistently with the source changes.

Confidence Score: 5/5

Safe to merge — changes are purely documentation/comment reformatting with no functional impact.

All changes are limited to doc comments and their derived generated outputs. No logic, data paths, or interfaces are touched. Content is semantically preserved across all 22 source files and the regenerated docs are consistent with the source.

No files require special attention.

Important Files Changed

Filename Overview
crates/aube/src/commands/add.rs Doc comment reformatting for --global, --no-save, --save-catalog, --save-catalog-name, and --workspace; all content preserved.
crates/aube/src/commands/install/mod.rs Doc comment reformatting for --fix-lockfile, --force, --lockfile-dir, --merge-git-branch-lockfiles, --resolution-mode, and --verify-store-integrity; semantics intact.
crates/aube/src/commands/publish.rs Reformatted --force, --ignore-scripts, and --json doc comments; content preserved with correct sentence structure.
crates/aube/src/main.rs Reformatted ApproveBuilds and Check subcommand doc comments to have short summary + long prose.
docs/cli/commands.json Auto-generated JSON updated consistently with source comment changes; no manual edits required.

Reviews (1): Last reviewed commit: "fix(cli): wrap doc comments so -h help s..." | Re-trigger Greptile

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 2, 2026

Benchmark changes

Public ratios: warm installs vs Bun 7x -> 7x; warm installs vs pnpm 11x -> 10x.

Benchmark aube bun pnpm
Fresh install (warm cache) 332ms -> 261ms (-21%) 2242ms -> 1955ms (-13%) 3500ms -> 2643ms (-24%)
CI install (warm cache, GVS disabled) 930ms -> 967ms (+4%) 1447ms -> 2028ms (+40%) 2475ms -> 2618ms (+6%)
CI install (cold cache, GVS disabled) 4364ms -> 4299ms (-1%) 4083ms -> 4464ms (+9%) 5380ms -> 5033ms (-6%)

3e243a3 vs b2a7c3f | aube/bun/pnpm | 3 scenarios | 3 runs | 500mbit/50ms | generated by Codex.

@jdx jdx merged commit 71ec8ef into main May 2, 2026
20 checks passed
@jdx jdx deleted the fix/cli-help-line-wrapping branch May 2, 2026 20:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant