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

Method getVersionTemplateFunc

command.go:631–640  ·  view source on GitHub ↗

getVersionTemplateFunc returns the version template function for the command going up the command tree if necessary.

()

Source from the content-addressed store, hash-verified

629// getVersionTemplateFunc returns the version template function for the command
630// going up the command tree if necessary.
631func (c *Command) getVersionTemplateFunc() func(w io.Writer, data interface{}) error {
632 if c.versionTemplate != nil {
633 return c.versionTemplate.fn
634 }
635
636 if c.HasParent() {
637 return c.parent.getVersionTemplateFunc()
638 }
639 return defaultVersionFunc
640}
641
642// ErrPrefix return error message prefix for the command
643func (c *Command) ErrPrefix() string {

Callers 1

executeMethod · 0.95

Calls 1

HasParentMethod · 0.95

Tested by

no test coverage detected