28 lines
618 B
Go
28 lines
618 B
Go
package cmd
|
|
|
|
import (
|
|
"strings"
|
|
|
|
"gitea.konchin.com/service/amane-tanikaze-dcbot/amane/cmd/migrates"
|
|
"github.com/spf13/cobra"
|
|
"github.com/spf13/viper"
|
|
)
|
|
|
|
var RootCmd = &cobra.Command{
|
|
Use: "amane",
|
|
Short: "Amane Tanikaze Discord Bot",
|
|
PersistentPreRun: func(cmd *cobra.Command, args []string) {
|
|
viper.AutomaticEnv()
|
|
viper.SetEnvKeyReplacer(strings.NewReplacer("-", "_"))
|
|
viper.BindPFlags(cmd.PersistentFlags())
|
|
viper.BindPFlags(cmd.Flags())
|
|
},
|
|
}
|
|
|
|
func init() {
|
|
cobra.EnableTraverseRunHooks = true
|
|
RootCmd.AddCommand(dcbotCmd)
|
|
RootCmd.AddCommand(backendCmd)
|
|
RootCmd.AddCommand(migrates.RootCmd)
|
|
}
|