MCPcopy
hub / github.com/cloudfoundry/cli / Requirements

Method Requirements

cf/commands/organization/rename_org.go:36–50  ·  view source on GitHub ↗
(requirementsFactory requirements.Factory, fc flags.FlagContext)

Source from the content-addressed store, hash-verified

34}
35
36func (cmd *RenameOrg) Requirements(requirementsFactory requirements.Factory, fc flags.FlagContext) ([]requirements.Requirement, error) {
37 if len(fc.Args()) != 2 {
38 cmd.ui.Failed(T("Incorrect Usage. Requires old org name, new org name as arguments\n\n") + commandregistry.Commands.CommandUsage("rename-org"))
39 return nil, fmt.Errorf("Incorrect usage: %d arguments of %d required", len(fc.Args()), 2)
40 }
41
42 cmd.orgReq = requirementsFactory.NewOrganizationRequirement(fc.Args()[0])
43
44 reqs := []requirements.Requirement{
45 requirementsFactory.NewLoginRequirement(),
46 cmd.orgReq,
47 }
48
49 return reqs, nil
50}
51
52func (cmd *RenameOrg) SetDependency(deps commandregistry.Dependency, pluginCall bool) commandregistry.Command {
53 cmd.ui = deps.UI

Callers

nothing calls this directly

Calls 5

CommandUsageMethod · 0.80
ArgsMethod · 0.65
FailedMethod · 0.65
NewLoginRequirementMethod · 0.65

Tested by

no test coverage detected