pcgamedb/cmd/version.go

24 lines
408 B
Go
Raw Normal View History

2024-09-25 09:47:13 -04:00
package cmd
import (
"fmt"
"pcgamedb/constant"
"runtime"
"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)
}