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

Method CommandExists

cf/commandregistry/registry.go:77–93  ·  view source on GitHub ↗
(name string)

Source from the content-addressed store, hash-verified

75}
76
77func (r *registry) CommandExists(name string) bool {
78 if strings.TrimSpace(name) == "" {
79 return false
80 }
81
82 var ok bool
83
84 if _, ok = r.cmd[name]; !ok {
85 alias, exists := r.alias[name]
86
87 if exists {
88 _, ok = r.cmd[alias]
89 }
90 }
91
92 return ok
93}
94
95func (r *registry) ListCommands() []string {
96 keys := make([]string, len(r.cmd))

Callers 5

CallCoreCommandMethod · 0.80
CommandMethod · 0.80
ExecuteMethod · 0.80
registry_test.goFile · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected