summaryrefslogtreecommitdiff
path: root/command.go
diff options
context:
space:
mode:
authorEyal Posener <[email protected]>2017-05-11 20:48:40 +0300
committerEyal Posener <[email protected]>2017-05-11 20:48:40 +0300
commit115e175c3d254b3a4797607821a0aab6f08058bb (patch)
tree81a786eb45eef5c59f02bb8f731efaa1f926f97b /command.go
parent967bae76f3132c210e6275653f9b603593973858 (diff)
Change Match to be a function
Diffstat (limited to 'command.go')
-rw-r--r--command.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/command.go b/command.go
index 4f2207a..6557162 100644
--- a/command.go
+++ b/command.go
@@ -53,8 +53,8 @@ func (c *Command) predict(a Args) (options []string, only bool) {
// add global available complete Predict
for flag := range c.Flags {
- if m := match.Prefix(flag); m.Match(a.Last) {
- options = append(options, m.String())
+ if match.Prefix(flag, a.Last) {
+ options = append(options, flag)
}
}
@@ -82,8 +82,8 @@ func (c *Command) searchSub(a Args) (sub string, all []string, only bool) {
// subCommands returns a list of matching sub commands
func (c *Command) subCommands(last string) (prediction []string) {
for sub := range c.Sub {
- if m := match.Prefix(sub); m.Match(last) {
- prediction = append(prediction, m.String())
+ if match.Prefix(sub, last) {
+ prediction = append(prediction, sub)
}
}
return