func NewKStoneEtcdOperatorCommand() *cobra.Command {
	o := options.NewKStoneEtcdOperatorOptions()

	cmd := &cobra.Command{
		Use:  "kstone-etcd-operator",
		Long: commandDesc,
		PersistentPreRunE: func(*cobra.Command, []string) error {
			restclient.SetDefaultWarningHandler(restclient.NoWarnings{})
			return nil
		},
		Run: func(cmd *cobra.Command, args []string) {
			version.PrintAndExitIfRequested("kstone-etcd-operator")
			cliflag.PrintFlags(cmd.Flags())

			c, err := o.Config(KnownControllers(), ControllersDisabledByDefault.List())
			if err != nil {
				fmt.Fprintf(os.Stderr, "%v\n", err)
				os.Exit(1)
			}
			ctx := apiserver.SetupSignalContext()
			if err := Run(ctx, c); err != nil {
				fmt.Fprintf(os.Stderr, "%v\n", err)
				os.Exit(1)
			}
		},
		Args: func(cmd *cobra.Command, args []string) error {
			for _, arg := range args {
				if len(arg) > 0 {
					return fmt.Errorf("%q does not take any arguments, got %q", cmd.CommandPath(), args)
				}
			}
			return nil
		},
	}

	fs := cmd.Flags()
	namedFlagSets := o.Flags(KnownControllers(), ControllersDisabledByDefault.List())
	version.AddFlags(namedFlagSets.FlagSet("global"))
	globalflag.AddGlobalFlags(namedFlagSets.FlagSet("global"), cmd.Name())
	for _, f := range namedFlagSets.FlagSets {
		fs.AddFlagSet(f)
	}
	usageFmt := "Usage:\n  %s\n"
	cols, _, _ := term.TerminalSize(cmd.OutOrStdout())
	cmd.SetUsageFunc(func(cmd *cobra.Command) error {
		fmt.Fprintf(cmd.OutOrStderr(), usageFmt, cmd.UseLine())
		cliflag.PrintSections(cmd.OutOrStderr(), namedFlagSets, cols)
		return nil
	})
	cmd.SetHelpFunc(func(cmd *cobra.Command, args []string) {
		fmt.Fprintf(cmd.OutOrStdout(), "%s\n\n"+usageFmt, cmd.Long, cmd.UseLine())
		cliflag.PrintSections(cmd.OutOrStdout(), namedFlagSets, cols)
	})

	return cmd
}
// NewKStoneEtcdOperatorCommand creates a *cobra.Command object with default parameters
NewKStoneEtcdOperatorCommand creates a *cobra.Command object with default parameters
// NewKStoneEtcdOperatorCommand creates a * cobra . Command object with default parameters
func NewKStoneEtcdOperatorCommand() *cobra.Command {
	o := options.NewKStoneEtcdOperatorOptions()
	cmd := &cobra.Command{
		Use:  "kstone-etcd-operator",
		Long: commandDesc,
		PersistentPreRunE: func(*cobra.Command, []string) error {
			restclient.SetDefaultWarningHandler(restclient.NoWarnings{})
			return nil
		},
		Run: func(cmd *cobra.Command, args []string) {
			version.PrintAndExitIfRequested("kstone-etcd-operator")
			cliflag.PrintFlags(cmd.Flags())
			c, err := o.Config(KnownControllers(), ControllersDisabledByDefault.List())
			if err != nil {
				fmt.Fprintf(os.Stderr, "%v\n", err)
				os.Exit(1)
			}
			ctx := apiserver.SetupSignalContext()
			if err := Run(ctx, c); err != nil {
				fmt.Fprintf(os.Stderr, "%v\n", err)
				os.Exit(1)
			}
		},
		Args: func(cmd *cobra.Command, args []string) error {
			for _, arg := range args {
				if len(arg) > 0 {
					return fmt.Errorf("%q does not take any arguments, got %q", cmd.CommandPath(), args)
				}
			}
			return nil
		},
	}
	fs := cmd.Flags()
	namedFlagSets := o.Flags(KnownControllers(), ControllersDisabledByDefault.List())
	version.AddFlags(namedFlagSets.FlagSet("global"))
	globalflag.AddGlobalFlags(namedFlagSets.FlagSet("global"), cmd.Name())
	for _, f := range namedFlagSets.FlagSets {
		fs.AddFlagSet(f)
	}
	usageFmt := "Usage:\n  %s\n"
	cols, _, _ := term.TerminalSize(cmd.OutOrStdout())
	cmd.SetUsageFunc(func(cmd *cobra.Command) error {
		fmt.Fprintf(cmd.OutOrStderr(), usageFmt, cmd.UseLine())
		cliflag.PrintSections(cmd.OutOrStderr(), namedFlagSets, cols)
		return nil
	})
	cmd.SetHelpFunc(func(cmd *cobra.Command, args []string) {
		fmt.Fprintf(cmd.OutOrStdout(), "%s\n\n"+usageFmt, cmd.Long, cmd.UseLine())
		cliflag.PrintSections(cmd.OutOrStdout(), namedFlagSets, cols)
	})
	return cmd
}
func NewKStoneEtcdOperatorCommand ( ) * cobra . Command { o := options . NewKStoneEtcdOperatorOptions ( ) cmd := & cobra . Command { Use : " " , Long : commandDesc , PersistentPreRunE : func ( * cobra . Command , [ ] string ) error { restclient . SetDefaultWarningHandler ( restclient . NoWarnings { } ) return nil } , Run : func ( cmd * cobra . Command , args [ ] string ) { version . PrintAndExitIfRequested ( " " ) cliflag . PrintFlags ( cmd . Flags ( ) ) c , err := o . Config ( KnownControllers ( ) , ControllersDisabledByDefault . List ( ) ) if err != nil { fmt . Fprintf ( os . Stderr , " \n " , err ) os . Exit ( 1 ) } ctx := apiserver . SetupSignalContext ( ) if err := Run ( ctx , c ) ; err != nil { fmt . Fprintf ( os . Stderr , " \n " , err ) os . Exit ( 1 ) } } , Args : func ( cmd * cobra . Command , args [ ] string ) error { for _ , arg := range args { if len ( arg ) > 0 { return fmt . Errorf ( " " , cmd . CommandPath ( ) , args ) } } return nil } , } fs := cmd . Flags ( ) namedFlagSets := o . Flags ( KnownControllers ( ) , ControllersDisabledByDefault . List ( ) ) version . AddFlags ( namedFlagSets . FlagSet ( " " ) ) globalflag . AddGlobalFlags ( namedFlagSets . FlagSet ( " " ) , cmd . Name ( ) ) for _ , f := range namedFlagSets . FlagSets { fs . AddFlagSet ( f ) } usageFmt := " \n \n " cols , _ , _ := term . TerminalSize ( cmd . OutOrStdout ( ) ) cmd . SetUsageFunc ( func ( cmd * cobra . Command ) error { fmt . Fprintf ( cmd . OutOrStderr ( ) , usageFmt , cmd . UseLine ( ) ) cliflag . PrintSections ( cmd . OutOrStderr ( ) , namedFlagSets , cols ) return nil } ) cmd . SetHelpFunc ( func ( cmd * cobra . Command , args [ ] string ) { fmt . Fprintf ( cmd . OutOrStdout ( ) , " \n \n " + usageFmt , cmd . Long , cmd . UseLine ( ) ) cliflag . PrintSections ( cmd . OutOrStdout ( ) , namedFlagSets , cols ) } ) return cmd }
NewKStoneEtcdOperatorCommand creates a *cobra.Command object with default parameters
NewKStoneEtcdOperatorCommand creates a * cobra . Command object with default parameters