Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Exit with error code from subcommands as well as root command
  • Loading branch information
Kellel authored and Corentin Chary committed Sep 14, 2017
1 parent 97936ed commit 19d35e1
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions cli/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"errors"
"fmt"
"net/url"
"os"

"github.com/spf13/cobra"
"github.com/spf13/viper"
Expand Down Expand Up @@ -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)
}
}
}

0 comments on commit 19d35e1

Please sign in to comment.