Skip to content
Myr

fix trailing <nil> on help output

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by spf13 · committed by spf13 · parent c491be3 · Browse files · 2 files+11 added−3 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

2 files+11 added−3 removed

  • other:+11 added−3 removed

2 files+11 added−3 removed

modified:command.go+9 added
174 unmodified lines
175 err := c.Commander().UsageFunc(c)176 return err177}178179func (c *Command) UsageString() string {180 tmpOutput := c.Commander().cmdr.output181 bb := new(bytes.Buffer)182 c.Commander().SetOutput(bb)183 c.Usage()184 c.Commander().cmdr.output = tmpOutput185 return bb.String()186}187188// The full path to this command189func (c *Command) CommandPath() string {190 str := c.Name()191 x := c
195 unmodified lines
modified:commander.go+2 added-3 removed
141 unmodified lines
142{{end}}143Use "{{.Commander.Name}} help [command]" for more information about that command.144`145146 c.HelpTemplate = `{{.Name}}147{{.Long | trim}}148{{if .Runnable}}{{.Usage}}{{end}}146 c.HelpTemplate = `{{.Long | trim}}147{{if .Runnable}}{{.UsageString}}{{end}}148`149}