add: version cmd

add: dockerfile
This commit is contained in:
2024-03-13 00:11:34 +08:00
parent 2a6e427c4c
commit 4c2ea5896b
8 changed files with 138 additions and 4 deletions

20
cmd/version.go Normal file
View File

@ -0,0 +1,20 @@
package cmd
import (
"fmt"
"github.com/spf13/cobra"
)
var versionCmd = &cobra.Command{
Use: "version",
Short: "Print version",
Long: "Print version",
Run: func(cmd *cobra.Command, args []string) {
fmt.Println("version: " + RootCmd.Version)
},
}
func init() {
RootCmd.AddCommand(versionCmd)
}