fix(cmd): don't print help on error

This commit is contained in:
Nightapes
2019-07-15 21:16:25 +02:00
parent 24c8f21967
commit e3b54c63b0

View File

@@ -1,7 +1,6 @@
package commands package commands
import ( import (
"fmt"
"os" "os"
"github.com/Nightapes/go-semantic-release/pkg/config" "github.com/Nightapes/go-semantic-release/pkg/config"
@@ -18,6 +17,7 @@ var rootCmd = &cobra.Command{
return err return err
} }
setLoglevel(level) setLoglevel(level)
cmd.SilenceUsage = true
return nil return nil
}, },
} }
@@ -26,7 +26,6 @@ var rootCmd = &cobra.Command{
func Execute(version string) { func Execute(version string) {
rootCmd.Version = version rootCmd.Version = version
if err := rootCmd.Execute(); err != nil { if err := rootCmd.Execute(); err != nil {
fmt.Println(err)
os.Exit(1) os.Exit(1)
} }
} }