From 09bc5dd8e563d79458cb9a4ea87812477ec11877 Mon Sep 17 00:00:00 2001 From: Kellen Fox Date: Wed, 2 Aug 2017 14:04:07 -0700 Subject: [PATCH] Fixes #898 (#938) Exit with error code from subcommands as well as root command --- cli/utils.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cli/utils.go b/cli/utils.go index 40588174..2ee7afa1 100644 --- a/cli/utils.go +++ b/cli/utils.go @@ -4,6 +4,7 @@ import ( "errors" "fmt" "net/url" + "os" "github.com/spf13/cobra" "github.com/spf13/viper" @@ -92,6 +93,7 @@ func CommandWrapper(command func(*cobra.Command, []string) error) func(*cobra.Co err := command(cmd, args) if err != nil { fmt.Printf("Error: %s\n", err) + os.Exit(1) } } }