MCPcopy Index your code
hub / github.com/cli/cli / renderMan

Function renderMan

internal/docs/man.go:96–105  ·  view source on GitHub ↗

renderMan will generate a man page for the given command and write it to w. The header argument may be nil, however obviously w may not.

(cmd *cobra.Command, header *GenManHeader, w io.Writer)

Source from the content-addressed store, hash-verified

94// renderMan will generate a man page for the given command and write it to
95// w. The header argument may be nil, however obviously w may not.
96func renderMan(cmd *cobra.Command, header *GenManHeader, w io.Writer) error {
97 if err := fillHeader(header, cmd.CommandPath()); err != nil {
98 return err
99 }
100
101 b := genMan(cmd, header)
102
103 _, err := w.Write(md2man.Render(b))
104 return err
105}
106
107func fillHeader(header *GenManHeader, name string) error {
108 if header.Title == "" {

Callers 8

genManTreeFromOptsFunction · 0.85
TestGenManDocFunction · 0.85
TestGenManSeeAlsoFunction · 0.85
TestGenManAliasesFunction · 0.85
TestGenManJSONFieldsFunction · 0.85
TestGenManDocExitCodesFunction · 0.85
BenchmarkGenManToFileFunction · 0.85

Calls 4

fillHeaderFunction · 0.85
genManFunction · 0.85
WriteMethod · 0.65
RenderMethod · 0.65

Tested by 7

TestGenManDocFunction · 0.68
TestGenManSeeAlsoFunction · 0.68
TestGenManAliasesFunction · 0.68
TestGenManJSONFieldsFunction · 0.68
TestGenManDocExitCodesFunction · 0.68
BenchmarkGenManToFileFunction · 0.68