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

Method SetUsageTemplate

command.go:318–324  ·  view source on GitHub ↗

SetUsageTemplate sets usage template. Can be defined by Application.

(s string)

Source from the content-addressed store, hash-verified

316
317// SetUsageTemplate sets usage template. Can be defined by Application.
318func (c *Command) SetUsageTemplate(s string) {
319 if s == "" {
320 c.usageTemplate = nil
321 return
322 }
323 c.usageTemplate = tmpl(s)
324}
325
326// SetFlagErrorFunc sets a function to generate an error when flag parsing
327// fails.

Callers 2

TestAddTemplateFunctionsFunction · 0.95
TestSetUsageTemplateFunction · 0.95

Calls 1

tmplFunction · 0.85

Tested by 2

TestAddTemplateFunctionsFunction · 0.76
TestSetUsageTemplateFunction · 0.76