mod(cli): remove version command and replace with flag instead
This commit is contained in:
@@ -8,7 +8,10 @@ import (
|
||||
"github.com/spf13/viper"
|
||||
)
|
||||
|
||||
const VERSION string = "0.1"
|
||||
|
||||
var (
|
||||
version bool
|
||||
dry_run bool
|
||||
rootCmd = &cobra.Command{
|
||||
Use: "gitw",
|
||||
@@ -24,6 +27,9 @@ func Execute() error {
|
||||
|
||||
func init() {
|
||||
cobra.OnInitialize(initConfig)
|
||||
// version flag
|
||||
rootCmd.Flags().BoolVarP(&version, "version", "v", false, "Print version of gitwarrior")
|
||||
rootCmd.Version = VERSION
|
||||
}
|
||||
|
||||
func initConfig() {
|
||||
|
||||
Reference in New Issue
Block a user