mod(cli): remove version command and replace with flag instead

This commit is contained in:
2023-10-26 15:57:20 +02:00
parent f57c65fba2
commit 65df4be21c
2 changed files with 6 additions and 20 deletions

View File

@@ -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() {