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

Function unquoteUsage

docs.go:21–35  ·  view source on GitHub ↗

Returns the placeholder, if any, and the unquoted usage string.

(usage string)

Source from the content-addressed store, hash-verified

19
20// Returns the placeholder, if any, and the unquoted usage string.
21func unquoteUsage(usage string) (string, string) {
22 for i := 0; i < len(usage); i++ {
23 if usage[i] == '`' {
24 for j := i + 1; j < len(usage); j++ {
25 if usage[j] == '`' {
26 name := usage[i+1 : j]
27 usage = usage[:i] + name + usage[j+1:]
28 return name, usage
29 }
30 }
31 break
32 }
33 }
34 return "", usage
35}
36
37func prefixedNames(names []string, placeholder string) string {
38 var prefixed strings.Builder

Callers 2

TestUnquoteUsageFunction · 0.85
stringifyFlagFunction · 0.85

Calls

no outgoing calls

Tested by 1

TestUnquoteUsageFunction · 0.68