Files
hk4e-go/cmd/hk4e/robot.go
T
2024-07-18 00:56:30 +08:00

27 lines
482 B
Go

package main
import (
cfg "hk4e/common/config"
"github.com/spf13/cobra"
"context"
"hk4e/robot/app"
)
func RobotCmd() *cobra.Command {
var configFile string
app.APPVERSION = VERSION
c := &cobra.Command{
Use: "robot",
Short: "robot server",
RunE: func(cmd *cobra.Command, args []string) error {
cfg.InitConfig(configFile)
return app.Run(context.Background())
},
}
c.Flags().StringVar(&configFile, "config", "application.toml", "config file")
return c
}