diff --git a/pkg/src/labeler.go b/pkg/src/labeler.go index fff2cc5..7a5c674 100755 --- a/pkg/src/labeler.go +++ b/pkg/src/labeler.go @@ -193,17 +193,21 @@ func (p ParamsStruct) aliasRun(args []string) error { i-- } if strings.HasPrefix(args[i], "--label") { - p.params["labelKey"] = strings.Split(args[i], "=")[1] - p.params["labelVal"] = strings.Split(args[i], "=")[2] - args = append(args[:i], args[i+1:]...) - i-- + if strings.Contains(args[i], "=") { + p.params["labelKey"] = strings.Split(args[i], "=")[1] + p.params["labelVal"] = strings.Split(args[i], "=")[2] + args = append(args[:i], args[i+1:]...) + i-- + } } if strings.HasPrefix(args[i], "-l") { - p.params["labelKey"] = strings.Split(args[i+1], "=")[0] - p.params["labelVal"] = strings.Split(args[i+1], "=")[1] - args = append(args[:i], args[i+2:]...) - i-- - i-- + if len(args) > i+1 && !strings.HasPrefix(args[i+1], "-") { + p.params["labelKey"] = strings.Split(args[i+1], "=")[0] + p.params["labelVal"] = strings.Split(args[i+1], "=")[1] + args = append(args[:i], args[i+2:]...) + i-- + i-- + } } } if p.flags["l-debug"] { @@ -286,6 +290,10 @@ func (p ParamsStruct) aliasRun(args []string) error { fmt.Printf("labeler.go: [debug] resources: Key: %s, Value: %s\n", key, value) } } + if p.params["l"] != "" { + log.Printf("\nlabeler plugin: %q:\n\n", "PluginLabeler") + p.PluginLabeler(false) + } } return nil diff --git a/test/.cache/9ed7e73414370c1671c47dc68db81593d1f4de140738fc692d95c093c4624cd4 b/test/.cache/9ed7e73414370c1671c47dc68db81593d1f4de140738fc692d95c093c4624cd4 new file mode 100644 index 0000000..098dd87 --- /dev/null +++ b/test/.cache/9ed7e73414370c1671c47dc68db81593d1f4de140738fc692d95c093c4624cd4 @@ -0,0 +1,14 @@ + >I§Fó(wÐ,2Å.Ygç¶ã¶Ó