summaryrefslogtreecommitdiff
path: root/command.go
diff options
context:
space:
mode:
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
}