MCPcopy Create free account
hub / github.com/cloudfoundry/cli / Requirements

Method Requirements

cf/commands/application/disable_ssh.go:38–53  ·  view source on GitHub ↗
(requirementsFactory requirements.Factory, fc flags.FlagContext)

Source from the content-addressed store, hash-verified

36}
37
38func (cmd *DisableSSH) Requirements(requirementsFactory requirements.Factory, fc flags.FlagContext) ([]requirements.Requirement, error) {
39 if len(fc.Args()) != 1 {
40 cmd.ui.Failed(T("Incorrect Usage. Requires APP_NAME as argument\n\n") + commandregistry.Commands.CommandUsage("disable-ssh"))
41 return nil, fmt.Errorf("Incorrect usage: %d arguments of %d required", len(fc.Args()), 1)
42 }
43
44 cmd.appReq = requirementsFactory.NewApplicationRequirement(fc.Args()[0])
45
46 reqs := []requirements.Requirement{
47 requirementsFactory.NewLoginRequirement(),
48 requirementsFactory.NewTargetedSpaceRequirement(),
49 cmd.appReq,
50 }
51
52 return reqs, nil
53}
54
55func (cmd *DisableSSH) SetDependency(deps commandregistry.Dependency, pluginCall bool) commandregistry.Command {
56 cmd.ui = deps.UI

Callers

nothing calls this directly

Calls 6

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

Tested by

no test coverage detected