From cf1771e99e405f52f511cc72f4a815d397274de6 Mon Sep 17 00:00:00 2001 From: Ian Howell Date: Thu, 7 May 2020 08:58:38 -0500 Subject: [PATCH] Fix PrintErrln and PrintErrf This makes PrintErrln and PrintErrf print their output to the command's Err output as documented. --- command.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/command.go b/command.go index 88e6ed77..59d6f928 100644 --- a/command.go +++ b/command.go @@ -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.