Skip to content

Commit

Permalink
version info added
Browse files Browse the repository at this point in the history
  • Loading branch information
musanmaz committed Jun 26, 2024
1 parent 54498d0 commit abfe2ca
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ import (
"github.com/spf13/cobra"
)

const version = "1.0.4"

var consulAddr string

var rootCmd = &cobra.Command{
Expand All @@ -25,7 +27,16 @@ var rootCmd = &cobra.Command{
},
}

var versionCmd = &cobra.Command{
Use: "version",
Short: "Print the version number of Consul Uploader",
Run: func(cmd *cobra.Command, args []string) {
fmt.Println("Consul Uploader v" + version)
},
}

func init() {
rootCmd.AddCommand(versionCmd)
rootCmd.PersistentFlags().StringVar(&consulAddr, "consul-addr", "http://localhost:8500", "Consul address")
}

Expand Down

0 comments on commit abfe2ca

Please sign in to comment.