// NewListCommand creates a new command to list connector clusters
NewListCommand creates a new command to list connector clusters
// NewListCommand creates a new command to list connector clusters
func NewListCommand(f *factory.Factory) *cobra.Command {
	opts := &options{
		page:  0,
		limit: 100,
		f:     f,
	}
	cmd := &cobra.Command{
		Use:     "list",
		Short:   f.Localizer.MustLocalize("connector.cluster.list.cmd.shortDescription"),
		Long:    f.Localizer.MustLocalize("connector.cluster.list.cmd.longDescription"),
		Example: f.Localizer.MustLocalize("connector.cluster.list.cmd.example"),
		Args:    cobra.NoArgs,
		RunE: func(cmd *cobra.Command, args []string) error {
			if opts.outputFormat != "" && !flagutil.IsValidInput(opts.outputFormat, flagutil.ValidOutputFormats...) {
				return flagutil.InvalidValueError("output", opts.outputFormat, flagutil.ValidOutputFormats...)
			}
			return runList(opts)
		},
	}
	flags := flagutil.NewFlagSet(cmd, f.Localizer)
	flags.AddOutput(&opts.outputFormat)
	flags.IntVar(&opts.page, "page", int(cmdutil.ConvertPageValueToInt32(build.DefaultPageNumber)), f.Localizer.MustLocalize("connector.common.list.flag.page"))
	flags.IntVar(&opts.limit, "limit", 100, f.Localizer.MustLocalize("connector.common.list.flag.limit"))
	return cmd
}
func NewListCommand ( f * factory . Factory ) * cobra . Command { opts := & options { page : 0 , limit : 100 , f : f , } cmd := & cobra . Command { Use : " " , Short : f . Localizer . MustLocalize ( " " ) , Long : f . Localizer . MustLocalize ( " " ) , Example : f . Localizer . MustLocalize ( " " ) , Args : cobra . NoArgs , RunE : func ( cmd * cobra . Command , args [ ] string ) error { if opts . outputFormat != " " && ! flagutil . IsValidInput ( opts . outputFormat , flagutil . ValidOutputFormats ... ) { return flagutil . InvalidValueError ( " " , opts . outputFormat , flagutil . ValidOutputFormats ... ) } return runList ( opts ) } , } flags := flagutil . NewFlagSet ( cmd , f . Localizer ) flags . AddOutput ( & opts . outputFormat ) flags . IntVar ( & opts . page , " " , int ( cmdutil . ConvertPageValueToInt32 ( build . DefaultPageNumber ) ) , f . Localizer . MustLocalize ( " " ) ) flags . IntVar ( & opts . limit , " " , 100 , f . Localizer . MustLocalize ( " " ) ) return cmd }
NewListCommand creates a new command to list connector clusters
NewListCommand creates a new command to list connector clusters