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

Method UsageTemplate

command.go:592–601  ·  view source on GitHub ↗

UsageTemplate returns usage template for the command. This function is kept for backwards-compatibility reasons.

()

Source from the content-addressed store, hash-verified

590// UsageTemplate returns usage template for the command.
591// This function is kept for backwards-compatibility reasons.
592func (c *Command) UsageTemplate() string {
593 if c.usageTemplate != nil {
594 return c.usageTemplate.tmpl
595 }
596
597 if c.HasParent() {
598 return c.parent.UsageTemplate()
599 }
600 return defaultUsageTemplate
601}
602
603// HelpTemplate return help template for the command.
604// This function is kept for backwards-compatibility reasons.

Callers

nothing calls this directly

Calls 1

HasParentMethod · 0.95

Tested by

no test coverage detected