Added comma support to tags

dev
Ice3man543 2021-02-05 15:15:41 +05:30
parent 74c023016c
commit fbf5be544f
1 changed files with 12 additions and 8 deletions

View File

@ -165,18 +165,22 @@ func matchTemplateWithTags(tags string, options *types.Options) error {
matched := false
mainLoop:
for _, tag := range options.Tags {
for _, t := range options.Tags {
commaTags := strings.Split(t, ",")
for _, tag := range commaTags {
key, value := getKeyValue(tag)
for _, templTag := range actualTags {
templTag = strings.TrimSpace(templTag)
tKey, tValue := getKeyValue(templTag)
if strings.EqualFold(key, tKey) && strings.EqualFold(value, tValue) {
matched = true
break mainLoop
}
}
}
}
if !matched {
return errors.New("could not match template tags with input")
}