diff --git a/cmd/podcli/version.go b/cmd/podcli/version.go new file mode 100644 index 0000000..9f6c978 --- /dev/null +++ b/cmd/podcli/version.go @@ -0,0 +1,21 @@ +package main + +import ( + "fmt" + + "github.com/spf13/cobra" + "github.com/stefanprodan/k8s-podinfo/pkg/version" +) + +func init() { + rootCmd.AddCommand(versionCmd) +} + +var versionCmd = &cobra.Command{ + Use: `version`, + Short: "Prints podcli version", + RunE: func(cmd *cobra.Command, args []string) error { + fmt.Println(version.VERSION) + return nil + }, +}