MCPcopy Create free account
hub / github.com/apache/openwhisk-cli / buildParamDescription

Function buildParamDescription

commands/util.go:468–478  ·  view source on GitHub ↗

buildParamDescription(params) returns a default entity description for `$ wsk [ENTITY] get [ENTITY_NAME] --summary` when parameters are defined, but the entity description under annotations is not.

(params string)

Source from the content-addressed store, hash-verified

466// `$ wsk [ENTITY] get [ENTITY_NAME] --summary` when parameters are defined,
467// but the entity description under annotations is not.
468func buildParamDescription(params string) string {
469 preamble := "Returns a result based on parameter"
470 params = strings.Replace(params, "*", "", -1)
471 temp := strings.Split(params, ",")
472 if len(temp) > 1 {
473 lastParam := temp[len(temp)-1]
474 newParams := strings.Replace(params, fmt.Sprintf(",%s", lastParam), fmt.Sprintf(" and%s", lastParam), 1)
475 return fmt.Sprintf("%ss %s", preamble, newParams)
476 }
477 return fmt.Sprintf("%s %s", preamble, params)
478}
479
480func getFullName(namespace string, packageName string, entityName string) string {
481 var fullName string

Callers 1

printEntitySummaryFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected