summaryrefslogtreecommitdiff
path: root/command.go
diff options
context:
space:
mode:
authorEyal Posener <[email protected]>2017-05-05 23:07:18 +0300
committerEyal Posener <[email protected]>2017-05-05 23:07:18 +0300
commitc8263230e11aa755d3b0b964d4bf7ff296661f5e (patch)
tree257d6dfb9218ad536d3b20956b499f2b74ef271c /command.go
parent04d16f6064c7c71068f47b4e7106f15a05b6b326 (diff)
Add additional args
add predition of directories add ability for prediction union
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 9292a89..e2f5eb4 100644
--- a/command.go
+++ b/command.go
@@ -7,6 +7,7 @@ type Flags map[string]Predicate
type Command struct {
Sub Commands
Flags Flags
+ Args Predicate
}
// options returns all available complete options for the given command
@@ -38,6 +39,11 @@ func (c *Command) options(args []string) (options []Option, only bool) {
options = append(options, Arg(flag))
}
+ // add additional expected argument of the command
+ if c.Args.Expects {
+ options = append(options, c.Args.predict()...)
+ }
+
return
}