1
0
mirror of https://github.com/woodpecker-ci/woodpecker.git synced 2024-12-12 08:23:48 +02:00
woodpecker/cli/output/output.go
Robert Kaussow e229a8e633
Add cli output handlers (#3660)
Co-authored-by: Anbraten <6918444+anbraten@users.noreply.github.com>
2024-05-02 08:43:46 +02:00

25 lines
354 B
Go

package output
import (
"errors"
"strings"
)
var ErrOutputOptionRequired = errors.New("output option required")
func ParseOutputOptions(out string) (string, []string) {
out, opt, found := strings.Cut(out, "=")
if !found {
return out, nil
}
var optList []string
if opt != "" {
optList = strings.Split(opt, ",")
}
return out, optList
}