Send error messages to stderr. #249

This commit is contained in:
Andrey Smirnov
2015-05-28 11:30:35 +03:00
parent 5cd3c33854
commit 78b6d6ca7b
+2 -1
View File
@@ -4,6 +4,7 @@ import (
"fmt"
ctx "github.com/smira/aptly/context"
"github.com/smira/commander"
"os"
)
// Run runs single command starting from root cmd with args, optionally initializing context
@@ -14,7 +15,7 @@ func Run(cmd *commander.Command, cmdArgs []string, initContext bool) (returnCode
if !ok {
panic(r)
}
fmt.Println("ERROR:", fatal.Message)
fmt.Fprintln(os.Stderr, "ERROR:", fatal.Message)
returnCode = fatal.ReturnCode
}
}()