diff options
| author | Dave Henderson <dhenderson@gmail.com> | 2018-07-16 23:36:23 -0400 |
|---|---|---|
| committer | Dave Henderson <dhenderson@gmail.com> | 2018-07-17 00:06:49 -0400 |
| commit | 65188db38ebde5457581aa43e537cfa8a824a13a (patch) | |
| tree | 71a8c2572b2d3ba86579b4c9e14090e6940b9f7a /cmd | |
| parent | 88dd5b24de06d8a81fb2477680ab3252fcd1f69a (diff) | |
Reducing output on template errors
Signed-off-by: Dave Henderson <dhenderson@gmail.com>
Diffstat (limited to 'cmd')
| -rw-r--r-- | cmd/gomplate/main.go | 8 |
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) } } |
