Skip to content

Add help text to CLI subcommands and global flags #43

Description

@owenthcarey

Summary

weaveffi --help, weaveffi <sub> --help, and the man pages from weaveffi man (#40) all derive their descriptions from Rust doc comments on the clap definition in crates/weaveffi-cli/src/main.rs. The argument fields already have them, but none of the 14 Commands variants do, and neither do the global --quiet and --verbose flags. As a result, weaveffi --help lists subcommands without saying what they do, and weaveffi.1 has empty OPTIONS entries and a SUBCOMMANDS list with no descriptions.

Proposed change

  • Add a one-line /// comment to every Commands variant (New, Generate, Validate, Package, Extract, Lint, Diff, Doctor, Completions, Man, SchemaVersion, Watch, Format, Schema). Clap uses the first line as the subcommand's about, so keep it short and in the imperative ("Generate bindings for one or more targets"). The README's CLI reference table is a good source for wording.
  • Add /// comments to the quiet and verbose fields on Cli, and to the name field on New.
  • While you're in the man-page area, tidy the "Generating Man Pages" section in docs/src/getting-started.md: retitle it to sentence case (## Generating man pages) to match the rest of the file, drop the mkdir -p ./man line (the command creates the directory itself), and change the README table wording from "to the specified directory" to "into the specified directory".

Only the help text changes. No flags, defaults, or behavior should change, and the completions_* and man_generation tests should pass unchanged.

Acceptance criteria

  • weaveffi --help shows a description next to every subcommand and next to --quiet and --verbose
  • weaveffi man --out ./man && man ./man/weaveffi.1 shows the descriptions in OPTIONS and SUBCOMMANDS, and man ./man/weaveffi-generate.1 has a non-empty DESCRIPTION
  • cargo fmt --check, cargo clippy --all-targets -- -D warnings, and cargo test -p weaveffi-cli pass
  • The docs tweaks above are included

Pointers

  • Clap definition: crates/weaveffi-cli/src/main.rs (struct Cli, enum Commands)
  • Existing per-argument doc comments in the same enum show the style to follow
  • Wording source: the CLI reference table in README.md
  • Docs section: docs/src/getting-started.md, "Generating Man Pages"

Suggested commit message

feat: add help text to CLI subcommands and global flags

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions