getVersionTemplateFunc returns the version template function for the command going up the command tree if necessary.
()
| 629 | // getVersionTemplateFunc returns the version template function for the command |
| 630 | // going up the command tree if necessary. |
| 631 | func (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 |
| 643 | func (c *Command) ErrPrefix() string { |