main: 'type' keyword should always be evaluated

Resolves #21. When using `-k` option, gomtree should use
only the keywords specified by the user, as well as the 'type'
keyword if it wasn't specified.

Signed-off-by: Stephen Chung <schung@redhat.com>
This commit is contained in:
Stephen Chung 2016-07-15 09:59:18 -04:00
parent a29236e678
commit 992a4757b0
1 changed files with 3 additions and 0 deletions

View File

@ -47,6 +47,9 @@ func main() {
// -k <keywords>
if *flUseKeywords != "" {
currentKeywords = splitKeywordsArg(*flUseKeywords)
if !inSlice("type", currentKeywords) {
currentKeywords = append([]string{"type"}, currentKeywords...)
}
} else {
currentKeywords = mtree.DefaultKeywords[:]
}