// NewCreateCommand a new command to create a new namespace
NewCreateCommand a new command to create a new namespace
// NewCreateCommand a new command to create a new namespace
func NewCreateCommand(f *factory.Factory) *cobra.Command {
	opts := &options{
		f: f,
	}
	cmd := &cobra.Command{
		Use:     "create",
		Short:   f.Localizer.MustLocalize("connector.namespace.create.cmd.shortDescription"),
		Long:    f.Localizer.MustLocalize("connector.namespace.create.cmd.longDescription"),
		Example: f.Localizer.MustLocalize("connector.namespace.create.cmd.example"),
		Args:    cobra.NoArgs,
		RunE: func(cmd *cobra.Command, args []string) error {
			validator := connectorcmdutil.Validator{
				Localizer: f.Localizer,
			}
			if err := validator.ValidateNamespace(opts.name); err != nil {
				return err
			}
			return runCreate(opts)
		},
	}
	flags := flagutil.NewFlagSet(cmd, f.Localizer)
	flags.StringVar(&opts.name, "name", "", f.Localizer.MustLocalize("connector.namespace.create.flag.name.description"))
	flags.BoolVar(&opts.eval, "eval", false, f.Localizer.MustLocalize("connector.namespace.create.flag.eval.description"))
	flags.AddOutput(&opts.outputFormat)
	return cmd
}
func NewCreateCommand ( f * factory . Factory ) * cobra . Command { opts := & options { 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 { validator := connectorcmdutil . Validator { Localizer : f . Localizer , } if err := validator . ValidateNamespace ( opts . name ) ; err != nil { return err } return runCreate ( opts ) } , } flags := flagutil . NewFlagSet ( cmd , f . Localizer ) flags . StringVar ( & opts . name , " " , " " , f . Localizer . MustLocalize ( " " ) ) flags . BoolVar ( & opts . eval , " " , false , f . Localizer . MustLocalize ( " " ) ) flags . AddOutput ( & opts . outputFormat ) return cmd }
NewCreateCommand a new command to create a new namespace
NewCreateCommand a new command to create a new namespace