summaryrefslogtreecommitdiff
path: root/vendor/github.com/jessevdk/go-flags/command.go
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/github.com/jessevdk/go-flags/command.go')
-rw-r--r--vendor/github.com/jessevdk/go-flags/command.go11
1 files changed, 11 insertions, 0 deletions
diff --git a/vendor/github.com/jessevdk/go-flags/command.go b/vendor/github.com/jessevdk/go-flags/command.go
index 879465d7a..ac4f1e392 100644
--- a/vendor/github.com/jessevdk/go-flags/command.go
+++ b/vendor/github.com/jessevdk/go-flags/command.go
@@ -30,6 +30,12 @@ type Command struct {
// Whether positional arguments are required
ArgsRequired bool
+ // Whether to pass all arguments after the first non option as remaining
+ // command line arguments. This is equivalent to strict POSIX processing.
+ // This is command-local version of PassAfterNonOption Parser flag. It
+ // cannot be turned off when PassAfterNonOption Parser flag is set.
+ PassAfterNonOption bool
+
commands []*Command
hasBuiltinHelpGroup bool
args []*Arg
@@ -244,6 +250,7 @@ func (c *Command) scanSubcommandHandler(parentg *Group) scanHandler {
longDescription := mtag.Get("long-description")
subcommandsOptional := mtag.Get("subcommands-optional")
aliases := mtag.GetMany("alias")
+ passAfterNonOption := mtag.Get("pass-after-non-option")
subc, err := c.AddCommand(subcommand, shortDescription, longDescription, ptrval.Interface())
@@ -261,6 +268,10 @@ func (c *Command) scanSubcommandHandler(parentg *Group) scanHandler {
subc.Aliases = aliases
}
+ if len(passAfterNonOption) > 0 {
+ subc.PassAfterNonOption = true
+ }
+
return true, nil
}