summaryrefslogtreecommitdiff
path: root/cmd
diff options
context:
space:
mode:
Diffstat (limited to 'cmd')
-rw-r--r--cmd/gomplate/main.go8
1 files changed, 6 insertions, 2 deletions
diff --git a/cmd/gomplate/main.go b/cmd/gomplate/main.go
index 1ddcf120..bde6eb46 100644
--- a/cmd/gomplate/main.go
+++ b/cmd/gomplate/main.go
@@ -80,7 +80,11 @@ func newGomplateCmd() *cobra.Command {
printVersion(cmd.Name())
return nil
}
- return gomplate.RunTemplates(&opts)
+
+ err := gomplate.RunTemplates(&opts)
+ cmd.SilenceErrors = true
+ cmd.SilenceUsage = true
+ return err
},
PostRunE: postRunExec,
Args: optionalExecArgs,
@@ -111,7 +115,7 @@ func main() {
command := newGomplateCmd()
initFlags(command)
if err := command.Execute(); err != nil {
- fmt.Println(err)
+ fmt.Fprintln(os.Stderr, err)
os.Exit(1)
}
}