mirror of
https://github.com/spf13/cobra
synced 2025-05-07 13:57:21 +00:00
Fix PrintErrln and PrintErrf
This makes PrintErrln and PrintErrf print their output to the command's Err output as documented.
This commit is contained in:
parent
e392f3204d
commit
cf1771e99e
1 changed files with 2 additions and 2 deletions
|
@ -1179,12 +1179,12 @@ func (c *Command) PrintErr(i ...interface{}) {
|
|||
|
||||
// PrintErrln is a convenience method to Println to the defined Err output, fallback to Stderr if not set.
|
||||
func (c *Command) PrintErrln(i ...interface{}) {
|
||||
c.Print(fmt.Sprintln(i...))
|
||||
c.PrintErr(fmt.Sprintln(i...))
|
||||
}
|
||||
|
||||
// PrintErrf is a convenience method to Printf to the defined Err output, fallback to Stderr if not set.
|
||||
func (c *Command) PrintErrf(format string, i ...interface{}) {
|
||||
c.Print(fmt.Sprintf(format, i...))
|
||||
c.PrintErr(fmt.Sprintf(format, i...))
|
||||
}
|
||||
|
||||
// CommandPath returns the full path to this command.
|
||||
|
|
Loading…
Add table
Reference in a new issue