Module cli
Expand description
The cli generator: docs/reference/cli.md from the real command line.
The source of truth is atune_cli::Cli itself, walked through
clap::CommandFactory — the same type the shipped binary parses with, so a
new subcommand, flag, default or possible value appears on the page because
clap knows about it, never because someone remembered to add a row (D29,
docs/design/11-documentation-plan.md §7). This is what D32’s library target
bought: the alternative was scraping recursive --help text.
Two deliberate omissions, both to keep the page about atune:
- the
helpsubcommand clap synthesises (atune help <cmd>) is not a subcommand of atune’s, and the subcommand count (§1.3.13, twelve sincedoctor) excludes it; - a
hide-flagged command or argument is absent from--helpand is absent here for the same reason.
-h, --help and -V, --version are documented: they are real flags that
--help shows, and filtering them would make the page disagree with the tool.
Every write! below goes to a String, which cannot fail, so the results are
discarded with let _ rather than unwrapped — the workspace forbids an
expect that a reader would have to take on trust.
Structs§
- CliReference
- Generates the CLI reference page.
Constants§
- SYNTHETIC_
SUBCOMMAND 🔒 - The clap-synthesised subcommand, which is not part of atune’s surface.
Functions§
- is_
documented 🔒 - Is this a command the page should carry?
- one_
line 🔒 - Collapses one paragraph’s soft wrapping into a single line.
- paragraphs 🔒
- Splits help text into paragraphs, each collapsed onto one line.
- render_
argument 🔒 - Writes one argument: its spelling, its help, and its metadata.
- render_
arguments 🔒 - Writes one labelled group of arguments, if it has any.
- render_
command 🔒 - Writes one command’s section, then recurses into its subcommands.
- render_
metadata 🔒 - Writes the facts
--helpputs in brackets: required, default, allowed values. - spelling 🔒
- How an argument is spelled on a command line, exactly as
--helpspells it.