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:
parent
c74c2ed6d7
commit
843517f136
1 changed files with 5 additions and 1 deletions
|
@ -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>
|
||||||
|
|
Loading…
Reference in a new issue