1
0
Fork 0
mirror of https://github.com/vbatts/go-mtree.git synced 2024-11-26 10:05:40 +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> // -K <keywords>
if *flAddKeywords != "" { if *flAddKeywords != "" {
currentKeywords = append(currentKeywords, splitKeywordsArg(*flAddKeywords)...) for _, kw := range splitKeywordsArg(*flAddKeywords) {
if !inSlice(kw, currentKeywords) {
currentKeywords = append(currentKeywords, kw)
}
}
} }
// -f <file> // -f <file>