ashb commented on code in PR #56290: URL: https://github.com/apache/airflow/pull/56290#discussion_r2394497861
########## go-sdk/celery/commands/root.go: ########## @@ -42,61 +35,21 @@ var rootCmd = &cobra.Command{ All options (other than ` + "`--config`" + `) can be specified in the config file using the same name as the CLI argument but without the ` + "`--`" + ` prefix.`, PersistentPreRunE: func(cmd *cobra.Command, args []string) error { - return initializeConfig(cmd) + return config.Configure(cmd) }, } // Execute is the main entrypoint, and runs the Celery broker app and listens for Celery Tasks func Execute() { - cc.Init(&cc.Config{ - RootCmd: rootCmd, - Headings: cc.Bold, - Commands: cc.Yellow + cc.Bold, - Example: cc.Italic, - ExecName: cc.HiMagenta + cc.Bold, - Flags: cc.Green, - FlagsDataType: cc.Italic + cc.White, - }) err := rootCmd.ExecuteContext(context.Background()) if err != nil { os.Exit(1) } } func init() { - rootCmd.PersistentFlags().StringVar(&cfgFile, "config", "", - "config file (default is $HOME/airflow/go-sdk.yaml)") + config.InitColor(rootCmd) + rootCmd.PersistentFlags(). + String("config", "", "config file (default is $HOME/airflow/go-sdk.yaml)") rootCmd.AddCommand(runCmd) } - -// initConfig reads in config file and ENV variables if set. -func initializeConfig(cmd *cobra.Command) error { Review Comment: These fns moved to a shared location -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@airflow.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org