pcgamedb/cmd/version.go

25 lines
409 B
Go
Raw Permalink Normal View History

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