mirror of
https://github.com/opencloud-eu/opencloud.git
synced 2026-03-13 20:58:03 -04:00
added utils to flagset
This commit is contained in:
14
pkg/flagset/utils.go
Normal file
14
pkg/flagset/utils.go
Normal file
@@ -0,0 +1,14 @@
|
||||
package flagset
|
||||
|
||||
import "strings"
|
||||
|
||||
// ParseAppsFlag transforms a string of the format "a, b, c" into []string{"a", "b", "c"}
|
||||
func ParseAppsFlag(src string) []string {
|
||||
var apps []string
|
||||
parsed := strings.Split(src, ",")
|
||||
for _, v := range parsed {
|
||||
apps = append(apps, strings.TrimSpace(v))
|
||||
}
|
||||
|
||||
return apps
|
||||
}
|
||||
Reference in New Issue
Block a user