Add CLI version cmd

This commit is contained in:
Stefan Prodan
2018-09-07 14:54:35 +03:00
parent 79b2d784bf
commit a8a85e6aae

21
cmd/podcli/version.go Normal file
View File

@@ -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
},
}