Skip to main content

Module cli

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 help subcommand clap synthesises (atune help <cmd>) is not a subcommand of atune’s, and the subcommand count (§1.3.13, twelve since doctor) excludes it;
  • a hide-flagged command or argument is absent from --help and 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 --help puts in brackets: required, default, allowed values.
spelling 🔒
How an argument is spelled on a command line, exactly as --help spells it.