Files
inp2025/cmd.go
2025-10-16 09:44:49 +08:00

30 lines
506 B
Go

package main
import (
"strings"
"github.com/spf13/cobra"
"github.com/spf13/viper"
)
var RootCmd = &cobra.Command{
Use: "game",
PersistentPreRun: func(cmd *cobra.Command, args []string) {
viper.AutomaticEnv()
viper.SetEnvKeyReplacer(strings.NewReplacer("_", "-"))
viper.BindPFlags(cmd.PersistentFlags())
viper.BindPFlags(cmd.Flags())
},
}
func main() {
RootCmd.Execute()
}
func init() {
cobra.EnableTraverseRunHooks = true
RootCmd.AddCommand(authCmd)
RootCmd.AddCommand(playerCmd)
}