MCPcopy
hub / github.com/urfave/cli / prefixedNames

Function prefixedNames

docs.go:37–53  ·  view source on GitHub ↗
(names []string, placeholder string)

Source from the content-addressed store, hash-verified

35}
36
37func prefixedNames(names []string, placeholder string) string {
38 var prefixed strings.Builder
39 for i, name := range names {
40 if name == "" {
41 continue
42 }
43
44 prefixed.WriteString(prefixFor(name) + name)
45 if placeholder != "" {
46 prefixed.WriteString(" " + placeholder)
47 }
48 if i < len(names)-1 {
49 prefixed.WriteString(", ")
50 }
51 }
52 return prefixed.String()
53}
54
55func envFormat(envVars []string, prefix, sep, suffix string) string {
56 if len(envVars) > 0 {

Callers 1

stringifyFlagFunction · 0.85

Calls 2

prefixForFunction · 0.85
StringMethod · 0.45

Tested by

no test coverage detected