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

Method Requirements

cf/commands/application/stop.go:46–61  ·  view source on GitHub ↗
(requirementsFactory requirements.Factory, fc flags.FlagContext)

Source from the content-addressed store, hash-verified

44}
45
46func (cmd *Stop) Requirements(requirementsFactory requirements.Factory, fc flags.FlagContext) ([]requirements.Requirement, error) {
47 if len(fc.Args()) != 1 {
48 cmd.ui.Failed(T("Incorrect Usage. Requires an argument\n\n") + commandregistry.Commands.CommandUsage("stop"))
49 return nil, fmt.Errorf("Incorrect usage: %d arguments of %d required", len(fc.Args()), 1)
50 }
51
52 cmd.appReq = requirementsFactory.NewApplicationRequirement(fc.Args()[0])
53
54 reqs := []requirements.Requirement{
55 requirementsFactory.NewLoginRequirement(),
56 requirementsFactory.NewTargetedSpaceRequirement(),
57 cmd.appReq,
58 }
59
60 return reqs, nil
61}
62
63func (cmd *Stop) SetDependency(deps commandregistry.Dependency, pluginCall bool) commandregistry.Command {
64 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