1
0
Fork 0
mirror of https://github.com/vbatts/go-mtree.git synced 2025-06-03 18:02:28 +00:00

keyword: unify keyword synonyms

Signed-off-by: Vincent Batts <vbatts@hashbangbash.com>
This commit is contained in:
Vincent Batts 2016-11-16 15:42:53 -05:00
parent 627c6e9ddd
commit 5d26726bb1
Signed by: vbatts
GPG key ID: 10937E57733F1362
6 changed files with 124 additions and 3 deletions

View file

@ -396,7 +396,11 @@ func isTarSpec(spec *mtree.DirectoryHierarchy) bool {
}
func splitKeywordsArg(str string) []string {
return strings.Fields(strings.Replace(str, ",", " ", -1))
keywords := []string{}
for _, kw := range strings.Fields(strings.Replace(str, ",", " ", -1)) {
keywords = append(keywords, mtree.KeywordSynonym(kw))
}
return keywords
}
func inSlice(a string, list []string) bool {