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

Function hasSeeAlso

doc/util.go:26–37  ·  view source on GitHub ↗

Test to see if we have a reason to print See Also information in docs Basically this is a test for a parent command or a subcommand which is both not deprecated and not the autogenerated help command.

(cmd *cobra.Command)

Source from the content-addressed store, hash-verified

24// Basically this is a test for a parent command or a subcommand which is
25// both not deprecated and not the autogenerated help command.
26func hasSeeAlso(cmd *cobra.Command) bool {
27 if cmd.HasParent() {
28 return true
29 }
30 for _, c := range cmd.Commands() {
31 if !c.IsAvailableCommand() || c.IsAdditionalHelpTopicCommand() {
32 continue
33 }
34 return true
35 }
36 return false
37}
38
39// Temporary workaround for yaml lib generating incorrect yaml with long strings
40// that do not contain \n.

Callers 4

genManFunction · 0.85
GenYamlCustomFunction · 0.85
GenReSTCustomFunction · 0.85
GenMarkdownCustomFunction · 0.85

Calls 4

HasParentMethod · 0.80
CommandsMethod · 0.80
IsAvailableCommandMethod · 0.80

Tested by

no test coverage detected