From ce06aa48422fdcd5d61af561d00b93f626842635 Mon Sep 17 00:00:00 2001 From: Ben Morrison Date: Wed, 12 Feb 2020 23:01:13 -0500 Subject: [PATCH] sending errors to stderr --- cli.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cli.go b/cli.go index 3f174ae..14bfe4b 100644 --- a/cli.go +++ b/cli.go @@ -2,6 +2,7 @@ package main import ( "fmt" + "log" "os" mets "github.com/athul/pwcli/methods" @@ -119,7 +120,8 @@ func main() { err := app.Run(os.Args) if err != nil { + l := log.New(os.Stderr, "", 0) c := color.New(color.FgRed).Add(color.Bold) - c.Println(fmt.Sprintf("\n%s", err.Error())) + l.Println(c.Sprintf("\n%s", err.Error())) } }