MCPcopy
hub / github.com/cli/cli / GenManTree

Function GenManTree

internal/docs/man.go:26–37  ·  view source on GitHub ↗

GenManTree will generate a man page for this command and all descendants in the directory given. The header may be nil. This function may not work correctly if your command names have `-` in them. If you have `cmd` with two subcmds, `sub` and `sub-third`, and `sub` has a subcommand called `third` it

(cmd *cobra.Command, dir string)

Source from the content-addressed store, hash-verified

24// subcmds, `sub` and `sub-third`, and `sub` has a subcommand called `third`
25// it is undefined which help output will be in the file `cmd-sub-third.1`.
26func GenManTree(cmd *cobra.Command, dir string) error {
27 if os.Getenv("GH_COBRA") != "" {
28 return doc.GenManTreeFromOpts(cmd, doc.GenManTreeOptions{
29 Path: dir,
30 CommandSeparator: "-",
31 })
32 }
33 return genManTreeFromOpts(cmd, GenManTreeOptions{
34 Path: dir,
35 CommandSeparator: "-",
36 })
37}
38
39// genManTreeFromOpts generates a man page for the command and all descendants.
40// The pages are written to the opts.Path directory.

Callers 2

runFunction · 0.92
TestGenManTreeFunction · 0.85

Calls 1

genManTreeFromOptsFunction · 0.85

Tested by 1

TestGenManTreeFunction · 0.68