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
1 changed files with 5 additions and 1 deletions

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>