MCPcopy
hub / github.com/cli/cli / formatKeywords

Function formatKeywords

pkg/search/query.go:333–344  ·  view source on GitHub ↗
(ks []string)

Source from the content-addressed store, hash-verified

331}
332
333func formatKeywords(ks []string) []string {
334 result := make([]string, len(ks))
335 for i, k := range ks {
336 before, after, found := strings.Cut(k, ":")
337 if !found {
338 result[i] = quote(k)
339 } else {
340 result[i] = fmt.Sprintf("%s:%s", before, quote(after))
341 }
342 }
343 return result
344}
345
346// CamelToKebab returns a copy of the string s that is converted from camel case form to '-' separated form.
347func camelToKebab(s string) string {

Callers 2

StandardSearchStringMethod · 0.85

Calls 1

quoteFunction · 0.85

Tested by

no test coverage detected