feat: version

Signed-off-by: AlexsJones <alexsimonjones@gmail.com>
This commit is contained in:
AlexsJones
2023-03-27 20:40:15 +01:00
parent c3008c5e75
commit 931f072e0a
6 changed files with 12 additions and 20 deletions

View File

@@ -15,6 +15,7 @@ var (
cfgFile string
masterURL string
kubeconfig string
version string
)
// rootCmd represents the base command when called without any subcommands
@@ -29,7 +30,8 @@ var rootCmd = &cobra.Command{
// 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.
func Execute() {
func Execute(v string) {
version = v
err := rootCmd.Execute()
if err != nil {
os.Exit(1)