func (cmd *Push) Requirements(requirementsFactory requirements.Factory, fc flags.FlagContext) []requirements.Requirement { var reqs []requirements.Requirement usageReq := requirements.NewUsageRequirement(command_registry.CliCommandUsagePresenter(cmd), "", func() bool { return len(fc.Args()) > 1 }, ) reqs = append(reqs, usageReq) if fc.String("route-path") != "" { reqs = append(reqs, requirementsFactory.NewMinAPIVersionRequirement("Option '--route-path'", cf.RoutePathMinimumApiVersion)) } if fc.String("app-ports") != "" { reqs = append(reqs, requirementsFactory.NewMinAPIVersionRequirement("Option '--app-ports'", cf.MultipleAppPortsMinimumApiVersion)) } reqs = append(reqs, []requirements.Requirement{ requirementsFactory.NewLoginRequirement(), requirementsFactory.NewTargetedSpaceRequirement(), }...) return reqs }
func (cmd *ListPluginRepos) Requirements(requirementsFactory requirements.Factory, fc flags.FlagContext) []requirements.Requirement { usageReq := requirements.NewUsageRequirement(commandregistry.CLICommandUsagePresenter(cmd), T("No argument required"), func() bool { return len(fc.Args()) != 0 }, ) reqs := []requirements.Requirement{ usageReq, } return reqs }
func (cmd *RunningEnvironmentVariableGroup) Requirements(requirementsFactory requirements.Factory, fc flags.FlagContext) []requirements.Requirement { usageReq := requirements.NewUsageRequirement(commandregistry.CLICommandUsagePresenter(cmd), T("No argument required"), func() bool { return len(fc.Args()) != 0 }, ) reqs := []requirements.Requirement{ usageReq, requirementsFactory.NewLoginRequirement(), } return reqs }
func (cmd *listStagingSecurityGroups) Requirements(requirementsFactory requirements.Factory, fc flags.FlagContext) ([]requirements.Requirement, error) { usageReq := requirements.NewUsageRequirement(commandregistry.CLICommandUsagePresenter(cmd), T("No argument required"), func() bool { return len(fc.Args()) != 0 }, ) reqs := []requirements.Requirement{ usageReq, requirementsFactory.NewLoginRequirement(), } return reqs, nil }
func (cmd *ServiceAccess) Requirements(requirementsFactory requirements.Factory, fc flags.FlagContext) []requirements.Requirement { usageReq := requirements.NewUsageRequirement(command_registry.CliCommandUsagePresenter(cmd), T("No argument required"), func() bool { return len(fc.Args()) != 0 }, ) reqs := []requirements.Requirement{ usageReq, requirementsFactory.NewLoginRequirement(), } return reqs }
func (cmd *MarketplaceServices) Requirements(requirementsFactory requirements.Factory, fc flags.FlagContext) []requirements.Requirement { usageReq := requirements.NewUsageRequirement(commandregistry.CLICommandUsagePresenter(cmd), T("No argument required"), func() bool { return len(fc.Args()) != 0 }, ) reqs := []requirements.Requirement{ usageReq, requirementsFactory.NewAPIEndpointRequirement(), } return reqs }
func (cmd *OneTimeSSHCode) Requirements(requirementsFactory requirements.Factory, fc flags.FlagContext) ([]requirements.Requirement, error) { usageReq := requirements.NewUsageRequirement(commandregistry.CLICommandUsagePresenter(cmd), T("No argument required"), func() bool { return len(fc.Args()) != 0 }, ) reqs := []requirements.Requirement{ usageReq, requirementsFactory.NewAPIEndpointRequirement(), } return reqs, nil }
func (c *V3Apps) Requirements(requirementsFactory requirements.Factory, fc flags.FlagContext) ([]requirements.Requirement, error) { usageReq := requirements.NewUsageRequirement(commandregistry.CLICommandUsagePresenter(c), T("No argument required"), func() bool { return len(fc.Args()) != 0 }, ) reqs := []requirements.Requirement{ usageReq, requirementsFactory.NewLoginRequirement(), requirementsFactory.NewTargetedSpaceRequirement(), } return reqs, nil }
func (cmd *DeleteBuildpack) Requirements(requirementsFactory requirements.Factory, fc flags.FlagContext) []requirements.Requirement { usageReq := requirements.NewUsageRequirement(command_registry.CliCommandUsagePresenter(cmd), "", func() bool { return len(fc.Args()) != 1 }, ) loginReq := requirementsFactory.NewLoginRequirement() reqs := []requirements.Requirement{ usageReq, loginReq, } return reqs }
func (cmd *Target) Requirements(requirementsFactory requirements.Factory, fc flags.FlagContext) ([]requirements.Requirement, error) { usageReq := requirements.NewUsageRequirement(commandregistry.CLICommandUsagePresenter(cmd), T("No argument required"), func() bool { return len(fc.Args()) != 0 }, ) reqs := []requirements.Requirement{ usageReq, requirementsFactory.NewAPIEndpointRequirement(), } if fc.IsSet("o") || fc.IsSet("s") { reqs = append(reqs, requirementsFactory.NewLoginRequirement()) } return reqs, nil }
func (cmd *ListServiceAuthTokens) Requirements(requirementsFactory requirements.Factory, fc flags.FlagContext) []requirements.Requirement { usageReq := requirements.NewUsageRequirement(command_registry.CliCommandUsagePresenter(cmd), T("No argument required"), func() bool { return len(fc.Args()) != 0 }, ) maximumVersion, err := semver.Make("2.46.0") if err != nil { panic(err.Error()) } reqs := []requirements.Requirement{ usageReq, requirementsFactory.NewLoginRequirement(), requirementsFactory.NewMaxAPIVersionRequirement("service-auth-tokens", maximumVersion), } return reqs }