MCPcopy Index your code
hub / github.com/oapi-codegen/oapi-codegen / ParseCommandLineList

Function ParseCommandLineList

pkg/util/inputmapping.go:34–48  ·  view source on GitHub ↗

ParseCommandLineList parses comma separated string lists which are passed in on the command line. Spaces are trimmed off both sides of result strings.

(input string)

Source from the content-addressed store, hash-verified

32// in on the command line. Spaces are trimmed off both sides of result
33// strings.
34func ParseCommandLineList(input string) []string {
35 input = strings.TrimSpace(input)
36 if len(input) == 0 {
37 return nil
38 }
39 splitInput := strings.Split(input, ",")
40 args := make([]string, 0, len(splitInput))
41 for _, s := range splitInput {
42 s = strings.TrimSpace(s)
43 if len(s) > 0 {
44 args = append(args, s)
45 }
46 }
47 return args
48}
49
50// splitString splits a string along the specified separator, but it
51// ignores anything between double quotes for splitting. We do simple

Callers 2

updateConfigFromFlagsFunction · 0.92
updateOldConfigFromFlagsFunction · 0.92

Calls

no outgoing calls

Tested by

no test coverage detected