summaryrefslogtreecommitdiff
path: root/cmd/rr
diff options
context:
space:
mode:
authorDmitry Lihachev <[email protected]>2019-05-24 15:43:43 +0700
committerDmitry Lihachev <[email protected]>2019-05-24 15:59:44 +0700
commit2b874e9ed85bd85f42e60c29b0363f01a56e46e7 (patch)
tree31bacf035ad3f5494d4e76b64688a57726b029b4 /cmd/rr
parent1b1a43ce1140a7c4c4128d76ed1243d0d20b7c70 (diff)
Print errors to stderr
Diffstat (limited to 'cmd/rr')
-rw-r--r--cmd/rr/cmd/root.go9
1 files changed, 3 insertions, 6 deletions
diff --git a/cmd/rr/cmd/root.go b/cmd/rr/cmd/root.go
index 8d75f9cd..d6929473 100644
--- a/cmd/rr/cmd/root.go
+++ b/cmd/rr/cmd/root.go
@@ -63,8 +63,7 @@ var (
// This is called by main.main(). It only needs to happen once to the CLI.
func Execute() {
if err := CLI.Execute(); err != nil {
- util.Printf("<red+hb>Error:</reset> <red>%s</reset>\n", err)
- os.Exit(1)
+ util.ExitWithError(err)
}
}
@@ -98,14 +97,12 @@ func init() {
if workDir != "" {
if err := os.Chdir(workDir); err != nil {
- util.Printf("<red+hb>Error:</reset> <red>%s</reset>\n", err)
- os.Exit(1)
+ util.ExitWithError(err)
}
}
if err := Container.Init(cfg); err != nil {
- util.Printf("<red+hb>Error:</reset> <red>%s</reset>\n", err)
- os.Exit(1)
+ util.ExitWithError(err)
}
// global watcher config