In short: it hands the clap command tree to the clap-markdown crate and writes the result to stdout.
Upstream's own test runs it and keeps the output as a snapshot that the docs site includes, so the published CLI
reference is regenerated whenever a command's help changes.
The command is cmd_util_markdown_help. Its help text: "Print
the CLI help for all subcommands in Markdown" (source). It is the
MarkdownHelp variant of UtilCommand (source,
dispatch).
1. Command-line surface
No arguments: UtilMarkdownHelp is empty (source). The
global flags are on the CLI page.
3. End-to-end flow
4. Core architecture touchpoints
| Piece | Role here |
|---|---|
The clap command tree (command.app()) | The only input, so the Markdown always matches what jj help prints for the same binary (source). |
clap-markdown | Pinned to an exact version, because a new version would change the snapshot (source). |
cli-reference@.md.snap | The generated reference, marked "AUTO-GENERATED FILE, DO NOT EDIT" (source). |
| Repo, working copy, operation log | Not touched (source). |