mirror of
https://github.com/kubescape/kubescape.git
synced 2026-03-03 02:00:27 +00:00
25 lines
556 B
Go
25 lines
556 B
Go
package version
|
|
|
|
import (
|
|
"fmt"
|
|
"os"
|
|
|
|
"github.com/armosec/kubescape/cautils"
|
|
"github.com/spf13/cobra"
|
|
)
|
|
|
|
func GetVersionCmd() *cobra.Command {
|
|
versionCmd := &cobra.Command{
|
|
Use: "version",
|
|
Short: "Get current version",
|
|
Long: ``,
|
|
RunE: func(cmd *cobra.Command, args []string) error {
|
|
v := cautils.NewIVersionCheckHandler()
|
|
v.CheckLatestVersion(cautils.NewVersionCheckRequest(cautils.BuildNumber, "", "", "version"))
|
|
fmt.Fprintln(os.Stdout, "Your current version is: "+cautils.BuildNumber)
|
|
return nil
|
|
},
|
|
}
|
|
return versionCmd
|
|
}
|