Skip to content
Myr

Allow for explicit output to err/stderr

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

authored by Juan Leni · committed by Steve Francia · parent 0ea93dd · Browse files · 1 file+15 added−0 removed
This commit

State

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

Diff stats

1 file+15 added−0 removed

  • other:+15 added−0 removed

1 file+15 added−0 removed

modified:command.go+15 added
1119 unmodified lines
1120func (c *Command) Printf(format string, i ...interface{}) {1121 c.Print(fmt.Sprintf(format, i...))1122}11231124// PrintErr is a convenience method to Print to the defined Err output, fallback to Stderr if not set.1125func (c *Command) PrintErr(i ...interface{}) {1126 fmt.Fprint(c.ErrOrStderr(), i...)1127}11281129// PrintErrln is a convenience method to Println to the defined Err output, fallback to Stderr if not set.1130func (c *Command) PrintErrln(i ...interface{}) {1131 c.Print(fmt.Sprintln(i...))1132}11331134// PrintErrf is a convenience method to Printf to the defined Err output, fallback to Stderr if not set.1135func (c *Command) PrintErrf(format string, i ...interface{}) {1136 c.Print(fmt.Sprintf(format, i...))1137}11381139// CommandPath returns the full path to this command.1140func (c *Command) CommandPath() string {1141 if c.HasParent() {1142 return c.Parent().CommandPath() + " " + c.Name()
441 unmodified lines