diff options
| author | Eyal Posener <[email protected]> | 2017-05-11 20:48:40 +0300 |
|---|---|---|
| committer | Eyal Posener <[email protected]> | 2017-05-11 20:48:40 +0300 |
| commit | 115e175c3d254b3a4797607821a0aab6f08058bb (patch) | |
| tree | 81a786eb45eef5c59f02bb8f731efaa1f926f97b /command.go | |
| parent | 967bae76f3132c210e6275653f9b603593973858 (diff) | |
Change Match to be a function
Diffstat (limited to 'command.go')
| -rw-r--r-- | command.go | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -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 |
