summaryrefslogtreecommitdiff
path: root/command.go
diff options
context:
space:
mode:
authorEyal Posener <[email protected]>2017-05-05 21:59:10 +0300
committerEyal Posener <[email protected]>2017-05-05 22:15:23 +0300
commit04d16f6064c7c71068f47b4e7106f15a05b6b326 (patch)
tree5498e40a0104754d5f06ccfd125c82d2d13b2931 /command.go
parent5e07cbd4c20a5a3bb5bc84148dc4d4ebffa3d033 (diff)
Renamings
Diffstat (limited to 'command.go')
-rw-r--r--command.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/command.go b/command.go
index f3321fb..9292a89 100644
--- a/command.go
+++ b/command.go
@@ -2,7 +2,7 @@ package complete
type Commands map[string]Command
-type Flags map[string]FlagOptions
+type Flags map[string]Predicate
type Command struct {
Sub Commands
@@ -18,8 +18,8 @@ func (c *Command) options(args []string) (options []Option, only bool) {
// if prev has something that needs to follow it,
// it is the most relevant completion
- if options, ok := c.Flags[last(args)]; ok && options.HasFollow {
- return options.follows(), true
+ if predicate, ok := c.Flags[last(args)]; ok && predicate.Expects {
+ return predicate.predict(), true
}
sub, options, only := c.searchSub(args)