package main import ( "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 { return app.Run(context.Background(), configFile) }, } c.Flags().StringVar(&configFile, "config", "application.toml", "config file") return c }