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

Method Requirements

cf/commands/service/bind_service.go:80–98  ·  view source on GitHub ↗
(requirementsFactory requirements.Factory, fc flags.FlagContext)

Source from the content-addressed store, hash-verified

78}
79
80func (cmd *BindService) Requirements(requirementsFactory requirements.Factory, fc flags.FlagContext) ([]requirements.Requirement, error) {
81 if len(fc.Args()) != 2 {
82 cmd.ui.Failed(T("Incorrect Usage. Requires APP_NAME and SERVICE_INSTANCE as arguments\n\n") + commandregistry.Commands.CommandUsage("bind-service"))
83 return nil, fmt.Errorf("Incorrect usage: %d arguments of %d required", len(fc.Args()), 2)
84 }
85
86 serviceName := fc.Args()[1]
87
88 cmd.appReq = requirementsFactory.NewApplicationRequirement(fc.Args()[0])
89 cmd.serviceInstanceReq = requirementsFactory.NewServiceInstanceRequirement(serviceName)
90
91 reqs := []requirements.Requirement{
92 requirementsFactory.NewLoginRequirement(),
93 cmd.appReq,
94 cmd.serviceInstanceReq,
95 }
96
97 return reqs, nil
98}
99
100func (cmd *BindService) SetDependency(deps commandregistry.Dependency, pluginCall bool) commandregistry.Command {
101 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