Matches ctl version to upstream
This commit is contained in:
22
clitools/pkg/cmd/version/version.go
Normal file
22
clitools/pkg/cmd/version/version.go
Normal file
@@ -0,0 +1,22 @@
|
||||
package apply
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/spf13/cobra"
|
||||
|
||||
buildInfo "undecided.project/monok8s/pkg/buildinfo"
|
||||
)
|
||||
|
||||
func NewCmdVersion() *cobra.Command {
|
||||
cmd := &cobra.Command{
|
||||
Use: "version",
|
||||
Short: "Print the version information",
|
||||
RunE: func(cmd *cobra.Command, _ []string) error {
|
||||
|
||||
_, err := fmt.Fprintln(cmd.OutOrStdout(), buildInfo.Version)
|
||||
return err
|
||||
},
|
||||
}
|
||||
return cmd
|
||||
}
|
||||
Reference in New Issue
Block a user