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

Method HasAlias

command/common/command_list_v7.go:228–242  ·  view source on GitHub ↗

HasAlias returns true if the command alias is in the command list.

(alias string)

Source from the content-addressed store, hash-verified

226
227// HasAlias returns true if the command alias is in the command list.
228func (c commandList) HasAlias(alias string) bool {
229 if alias == "" {
230 return false
231 }
232
233 cType := reflect.TypeOf(c)
234 _, found := cType.FieldByNameFunc(
235 func(fieldName string) bool {
236 field, _ := cType.FieldByName(fieldName)
237 return field.Tag.Get("alias") == alias
238 },
239 )
240
241 return found
242}

Callers

nothing calls this directly

Calls 1

GetMethod · 0.65

Tested by

no test coverage detected