MCPcopy Create free account
hub / github.com/diillson/chatcli / trimQuotes

Function trimQuotes

cli/plugins/args_extract.go:141–149  ·  view source on GitHub ↗

trimQuotes strips a single matching pair of surrounding ASCII quotes.

(s string)

Source from the content-addressed store, hash-verified

139
140// trimQuotes strips a single matching pair of surrounding ASCII quotes.
141func trimQuotes(s string) string {
142 if len(s) < 2 {
143 return s
144 }
145 if (s[0] == '"' && s[len(s)-1] == '"') || (s[0] == '\'' && s[len(s)-1] == '\'') {
146 return s[1 : len(s)-1]
147 }
148 return s
149}
150
151// extractQueryArg is a convenience wrapper for builtins that show a
152// query string in the spinner. Tries the common key names used by both

Callers 10

argvToInnerJSONFunction · 0.85
docsFlattenArgvToMapFunction · 0.85
splitDocsFlattenCSVFunction · 0.85
diagramArgvToMapFunction · 0.85
registryTagsArgvToMapFunction · 0.85
contextArgvToMapFunction · 0.85
stringFromFlagArgsFunction · 0.85
parseToolsInvocationFunction · 0.85

Calls

no outgoing calls

Tested by 1