Help us shape the future of Go! Take the 2026 Go Developer Survey

clidoc

command
v0.16.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 31, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Command clidoc is DOCS-05's generator: it builds the full codegraph Cobra tree via internal/cli.NewRootCmd(), completes it with the completion command family and the -v/--version flag — both are otherwise registered only inside Command.ExecuteC() at execute time, so a plain, unexecuted tree never sees either — walks every available command in Cobra's own alphabetical order, and calls doc.GenMarkdownCustom once per documented command into ONE shared buffer. It writes exactly one file, the -out path, and never anything else. It never emits one file per command (cobra/doc's own GenMarkdownTree layout, rejected — D-02), never filters commands by a rule of its own (IsAvailableCommand() and IsAdditionalHelpTopicCommand() — cobra's own predicates — decide what's documented), and never sorts (Cobra's Commands() and pflag's SortFlags already sort; adding another sort would be redundant, not corrective).

Exit codes: 0 = wrote -out successfully, 1 = build or write error.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL