From 992a4757b0c7cdeb5de6d4fb7e7d7fd9d7adba56 Mon Sep 17 00:00:00 2001 From: Stephen Chung Date: Fri, 15 Jul 2016 09:59:18 -0400 Subject: [PATCH] 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 --- cmd/gomtree/main.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cmd/gomtree/main.go b/cmd/gomtree/main.go index 0941e2f..a70b303 100644 --- a/cmd/gomtree/main.go +++ b/cmd/gomtree/main.go @@ -47,6 +47,9 @@ func main() { // -k if *flUseKeywords != "" { currentKeywords = splitKeywordsArg(*flUseKeywords) + if !inSlice("type", currentKeywords) { + currentKeywords = append([]string{"type"}, currentKeywords...) + } } else { currentKeywords = mtree.DefaultKeywords[:] }