pcgamedb/cmd/version.go
nite07 304517e241
Some checks failed
release / goreleaser (push) Failing after 2m23s
docker / prepare-and-build (push) Failing after 2m55s
trans to private
2024-11-20 19:09:04 +08:00

25 lines
409 B
Go

package cmd
import (
"fmt"
"runtime"
"pcgamedb/constant"
"github.com/spf13/cobra"
)
var versionCmd = &cobra.Command{
Use: "version",
Long: "Get version of pcgamedb",
Short: "Get version of pcgamedb",
Run: func(cmd *cobra.Command, args []string) {
fmt.Printf("Version: %s\n", constant.Version)
fmt.Printf("Go: %s\n", runtime.Version())
},
}
func init() {
RootCmd.AddCommand(versionCmd)
}