26 lines
493 B
Go
26 lines
493 B
Go
package main
|
|
|
|
import (
|
|
"context"
|
|
|
|
cfg "hk4e/common/config"
|
|
"hk4e/dispatch/app"
|
|
|
|
"github.com/spf13/cobra"
|
|
)
|
|
|
|
func DispatchCmd() *cobra.Command {
|
|
var configFile string
|
|
app.APPVERSION = VERSION
|
|
c := &cobra.Command{
|
|
Use: "dispatch",
|
|
Short: "dispatch 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
|
|
}
|