pcgamedb/cmd/version.go

25 lines
427 B
Go
Raw Normal View History

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