1
0
Fork 0
mirror of https://github.com/vbatts/go-mtree.git synced 2024-12-22 05:46:30 +00:00

main: don't dupliate keywords

When adding keywords with -K, we don't want to
duplicate keywords in the keywords slice.

Signed-off-by: Stephen Chung <schung@redhat.com>
This commit is contained in:
Stephen Chung 2016-07-25 18:29:10 -04:00
parent c74c2ed6d7
commit 843517f136

View file

@ -102,7 +102,11 @@ func main() {
}
// -K <keywords>
if *flAddKeywords != "" {
currentKeywords = append(currentKeywords, splitKeywordsArg(*flAddKeywords)...)
for _, kw := range splitKeywordsArg(*flAddKeywords) {
if !inSlice(kw, currentKeywords) {
currentKeywords = append(currentKeywords, kw)
}
}
}
// -f <file>