// NewListCommand creates a new command to list available contexts
NewListCommand creates a new command to list available contexts
// NewListCommand creates a new command to list available contexts
func NewListCommand(f *factory.Factory) *cobra.Command {
	opts := &options{
		Connection:     f.Connection,
		IO:             f.IOStreams,
		Logger:         f.Logger,
		localizer:      f.Localizer,
		ServiceContext: f.ServiceContext,
	}
	cmd := &cobra.Command{
		Use:     "list",
		Short:   f.Localizer.MustLocalize("context.list.cmd.shortDescription"),
		Long:    f.Localizer.MustLocalize("context.list.cmd.longDescription"),
		Example: f.Localizer.MustLocalize("context.list.cmd.example"),
		Args:    cobra.NoArgs,
		RunE: func(cmd *cobra.Command, args []string) error {
			return runList(opts)
		},
	}
	flags := contextcmdutil.NewFlagSet(cmd, f)
	flags.AddOutput(&opts.outputFormat)
	return cmd
}
func NewListCommand ( f * factory . Factory ) * cobra . Command { opts := & options { Connection : f . Connection , IO : f . IOStreams , Logger : f . Logger , localizer : f . Localizer , ServiceContext : f . ServiceContext , } 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 { return runList ( opts ) } , } flags := contextcmdutil . NewFlagSet ( cmd , f ) flags . AddOutput ( & opts . outputFormat ) return cmd }
NewListCommand creates a new command to list available contexts
NewListCommand creates a new command to list available contexts