MCPcopy Index your code
hub / github.com/cloudfoundry/cli / Requirements

Method Requirements

cf/commands/target.go:45–63  ·  view source on GitHub ↗
(requirementsFactory requirements.Factory, fc flags.FlagContext)

Source from the content-addressed store, hash-verified

43}
44
45func (cmd *Target) Requirements(requirementsFactory requirements.Factory, fc flags.FlagContext) ([]requirements.Requirement, error) {
46 usageReq := requirements.NewUsageRequirement(commandregistry.CLICommandUsagePresenter(cmd),
47 T("No argument required"),
48 func() bool {
49 return len(fc.Args()) != 0
50 },
51 )
52
53 reqs := []requirements.Requirement{
54 usageReq,
55 requirementsFactory.NewAPIEndpointRequirement(),
56 }
57
58 if fc.IsSet("o") || fc.IsSet("s") {
59 reqs = append(reqs, requirementsFactory.NewLoginRequirement())
60 }
61
62 return reqs, nil
63}
64
65func (cmd *Target) SetDependency(deps commandregistry.Dependency, _ bool) commandregistry.Command {
66 cmd.ui = deps.UI

Callers

nothing calls this directly

Calls 6

NewUsageRequirementFunction · 0.92
CLICommandUsagePresenterFunction · 0.92
ArgsMethod · 0.65
IsSetMethod · 0.65
NewLoginRequirementMethod · 0.65

Tested by

no test coverage detected