MCPcopy
hub / github.com/spf13/cobra / manPrintOptions

Function manPrintOptions

doc/man_docs.go:187–200  ·  view source on GitHub ↗
(buf io.StringWriter, command *cobra.Command)

Source from the content-addressed store, hash-verified

185}
186
187func manPrintOptions(buf io.StringWriter, command *cobra.Command) {
188 flags := command.NonInheritedFlags()
189 if flags.HasAvailableFlags() {
190 cobra.WriteStringAndCheck(buf, "# OPTIONS\n")
191 manPrintFlags(buf, flags)
192 cobra.WriteStringAndCheck(buf, "\n")
193 }
194 flags = command.InheritedFlags()
195 if flags.HasAvailableFlags() {
196 cobra.WriteStringAndCheck(buf, "# OPTIONS INHERITED FROM PARENT COMMANDS\n")
197 manPrintFlags(buf, flags)
198 cobra.WriteStringAndCheck(buf, "\n")
199 }
200}
201
202func genMan(cmd *cobra.Command, header *GenManHeader) []byte {
203 cmd.InitDefaultHelpCmd()

Callers 1

genManFunction · 0.85

Calls 5

WriteStringAndCheckFunction · 0.92
manPrintFlagsFunction · 0.85
NonInheritedFlagsMethod · 0.80
HasAvailableFlagsMethod · 0.80
InheritedFlagsMethod · 0.80

Tested by

no test coverage detected