summaryrefslogtreecommitdiff
path: root/command.go
diff options
context:
space:
mode:
Diffstat (limited to 'command.go')
-rw-r--r--command.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/command.go b/command.go
index eeeb9e0..de501d5 100644
--- a/command.go
+++ b/command.go
@@ -74,6 +74,12 @@ func (c *Command) predict(a Args) (options []string, only bool) {
return
}
}
+
+ // We matched so stop searching. Continuing to search can accidentally
+ // match a subcommand with current set of commands, see issue #46.
+ if subCommandFound {
+ break
+ }
}
// if last completed word is a global flag that we need to complete