MCPcopy Create free account
hub / github.com/cli/cli / formatKeywords

Function formatKeywords

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

Source from the content-addressed store, hash-verified

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

Callers 2

StandardSearchStringMethod · 0.85

Calls 1

quoteFunction · 0.85

Tested by

no test coverage detected