package main import ( "fmt" "github.com/spf13/cobra" "hpds_mq/cmd" "os" ) var ( rootCmd = &cobra.Command{ Use: "hpds_mq", Long: "hpds_mq is a IoT broker that fully implements MQTT V5.0 and V3.1.1 protocol", Version: "0.1", } ) func init() { //rootCmd.PersistentFlags().StringVarP(&cmd.ConfigFileFlag, "config", "c", cmd.ConfigFileFlag, "The configuration file path") //rootCmd.PersistentFlags().StringVarP(&cmd.ConsulAddress, "remote", "r", cmd.ConsulAddress, "The configuration remote consul address") rootCmd.AddCommand(cmd.NewStartCmd()) //cmd.NewStartCmd() } func main() { if err := rootCmd.Execute(); err != nil { fmt.Fprint(os.Stderr, err.Error()) os.Exit(1) } }