Write errors to stderr instead of stdout

pull/13/head
Chris Bednarski 9 years ago
parent 1e90d1336c
commit ac92906cfc

@ -9,14 +9,12 @@ import (
func MaybeErrorln(c *cli.Context, message string) { func MaybeErrorln(c *cli.Context, message string) {
if !c.Bool("q") { if !c.Bool("q") {
fmt.Printf("%s: %s\n", c.Command.Name, message) os.Stderr.WriteString(fmt.Sprintf("%s: %s\n", c.Command.Name, message))
} }
} }
func MaybeError(c *cli.Context, message string) { func MaybeError(c *cli.Context, message string) {
if !c.Bool("q") { MaybeErrorln(c, message)
fmt.Printf("%s: %s\n", c.Command.Name, message)
}
os.Exit(1) os.Exit(1)
} }

Loading…
Cancel
Save