func Execute() {
	if err := rootCmd.Execute(); err != nil {
		log.Info(err)
		os.Exit(1)
	}
}
Execute adds all child commands to the root command and sets flags appropriately.
This is called by main.main(). It only needs to happen once to the rootCmd.
package cmd
import (
	"os"
	log "github.com/sirupsen/logrus"
	homedir "github.com/mitchellh/go-homedir"
	"github.com/spf13/cobra"
	"github.com/spf13/viper"
	"github.com/sstarcher/helm-release/git"
	"github.com/sstarcher/helm-release/helm"
	"github.com/sstarcher/helm-release/version"
)
var (
	cfgFile              string
	tag                  string
	skipTag              bool
	tagPath              string
	printComputedVersion bool
	bump                 string
	source               string
	strict               bool
)
var rootCmd = &cobra.Command{
	Use:   "helm-release [CHART_PATH]",
	Short: "Determines the charts next release number",
	Long: `This plugin will use environment variables and git history to divine the next chart version.
	It will also optionally update the image tag in the values.yaml file.`,
	Args: cobra.MinimumNArgs(1),
	RunE: func(cmd *cobra.Command, args []string) error {
		dir := "."
		if len(args) > 0 {
			dir = args[0]
		}
		var getter version.Getter
		if source == "git" {
			source, err := git.New(dir)
			if err != nil {
				return err
			}
			getter = source.(version.Getter)
		} else if source == "helm" {
			if bump == "" {
				log.Fatal("--bump must be specified when using a helm source")
			}
			source, err := helm.New(dir, nil)
			if err != nil {
				return err
			}
			getter = source.(version.Getter)
		} else {
			log.Fatalf("invalid input for source %s", source)
		}
		nextType := version.NewNextType(bump)
		version, err := getter.NextVersion(nextType)
		if version == nil {
			return err
		}
		if err != nil && strict {
			return err
		}
		if printComputedVersion {
			_, err = os.Stdout.WriteString(version.String())
			return err
		}
		log.Infof("updating the Chart.yaml to version %s", version.String())
		chart, err := helm.New(dir, &tagPath)
		if err != nil {
			return err
		}
		if !skipTag && tag == "" {
			ver, _ := version.SetMetadata("")
			tag = ver.String()
		}
		chart.UpdateChart(version, tag)
		return nil
	},
}