summaryrefslogtreecommitdiff
path: root/command.go
diff options
context:
space:
mode:
authorEyal Posener <[email protected]>2017-08-24 23:05:41 +0300
committerGitHub <[email protected]>2017-08-24 23:05:41 +0300
commit5075f6d6e69fb7b5a20a79ca0b87b16a484e2d2a (patch)
tree6b8f907761228fc3693b41a04a56e993fb9a2f38 /command.go
parentf4461a52b6329c11190f11fe3384ec8aa964e21c (diff)
parent1c43d25e3519cc70fc238d669f7b2aa826ac716a (diff)
Merge pull request #48 from dadgar/b-shared-prefix
Fix a subcommand matching
Diffstat (limited to 'command.go')
-rw-r--r--command.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/command.go b/command.go
index eeeb9e0..9614269 100644
--- a/command.go
+++ b/command.go
@@ -73,6 +73,10 @@ func (c *Command) predict(a Args) (options []string, only bool) {
if only {
return
}
+
+ // We matched so stop searching. Continuing to search can accidentally
+ // match a subcommand with current set of commands, see issue #46.
+ break
}
}