/*
registerRootCmd registers the flags and sets up everything for the root command
*/
registerRootCmd registers the flags and sets up everything for the root command
/ * registerRootCmd registers the flags and sets up everything for the root command * /
func registerRootCmd() {
	cobra.OnInitialize(initConfig)
	rootCmd.PersistentFlags().StringVarP(
		&cfgFile,
		"config",
		"c",
		"",
		"the config file to use",
	)
	rootCmd.PersistentFlags().StringP(
		"verbose",
		"v",
		"info",
		"the minimum log verbosity level",
	)
	if err := viper.BindPFlag("log.minimum_level", rootCmd.PersistentFlags().Lookup("verbose")); err != nil {
		slogger.Fatal(err.Error())
	}
	viper.SetDefault("log.minimum_level", "info")
	rootCmd.PersistentFlags().StringP(
		"dsn",
		"d",
		"",
		"the Sentry DSN endpoint to use",
	)
	if err := viper.BindPFlag("log.minimum_level", rootCmd.PersistentFlags().Lookup("dsn")); err != nil {
		slogger.Fatal(err.Error())
	}
	viper.SetDefault("log.sentry.dsn", "")
	rootCmd.PersistentFlags().StringVarP(&api.Queue, "queue", "q", "", "the queue to listen to")
	rootCmd.PersistentFlags().StringVarP(&api.Host, "api", "a", "http://localhost:8080", "the worker API to connect to")
}
func registerRootCmd ( ) { cobra . OnInitialize ( initConfig ) rootCmd . PersistentFlags ( ) . StringVarP ( & cfgFile , " " , " " , " " , " " , ) rootCmd . PersistentFlags ( ) . StringP ( " " , " " , " " , " " , ) if err := viper . BindPFlag ( " " , rootCmd . PersistentFlags ( ) . Lookup ( " " ) ) ; err != nil { slogger . Fatal ( err . Error ( ) ) } viper . SetDefault ( " " , " " ) rootCmd . PersistentFlags ( ) . StringP ( " " , " " , " " , " " , ) if err := viper . BindPFlag ( " " , rootCmd . PersistentFlags ( ) . Lookup ( " " ) ) ; err != nil { slogger . Fatal ( err . Error ( ) ) } viper . SetDefault ( " " , " " ) rootCmd . PersistentFlags ( ) . StringVarP ( & api . Queue , " " , " " , " " , " " ) rootCmd . PersistentFlags ( ) . StringVarP ( & api . Host , " " , " " , " " , " " ) }
registerRootCmd registers the flags and sets up everything for the root command
registerRootCmd registers the flags and sets up everything for the root command