summaryrefslogtreecommitdiff
path: root/vendor/github.com/spf13/cobra/args.go
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2021-12-16 20:21:51 +0100
committerGitHub <noreply@github.com>2021-12-16 20:21:51 +0100
commit2c98694559b6413ec4f9abdb6d3750b6dd46cc4f (patch)
tree8bc07d671616bc402c7062cda29d0d4c6c292009 /vendor/github.com/spf13/cobra/args.go
parentbe6f9ce92186bca7cce2a0b89f82cb7c7e720029 (diff)
parent03a3fc37fe82800113a1c9043448acb2afa539a6 (diff)
downloadpodman-2c98694559b6413ec4f9abdb6d3750b6dd46cc4f.tar.gz
podman-2c98694559b6413ec4f9abdb6d3750b6dd46cc4f.tar.bz2
podman-2c98694559b6413ec4f9abdb6d3750b6dd46cc4f.zip
Merge pull request #12608 from Luap99/cobra
bump cobra to 1.3.0
Diffstat (limited to 'vendor/github.com/spf13/cobra/args.go')
-rw-r--r--vendor/github.com/spf13/cobra/args.go12
1 files changed, 12 insertions, 0 deletions
diff --git a/vendor/github.com/spf13/cobra/args.go b/vendor/github.com/spf13/cobra/args.go
index 70e9b2629..20a022b30 100644
--- a/vendor/github.com/spf13/cobra/args.go
+++ b/vendor/github.com/spf13/cobra/args.go
@@ -107,3 +107,15 @@ func RangeArgs(min int, max int) PositionalArgs {
return nil
}
}
+
+// MatchAll allows combining several PositionalArgs to work in concert.
+func MatchAll(pargs ...PositionalArgs) PositionalArgs {
+ return func(cmd *Command, args []string) error {
+ for _, parg := range pargs {
+ if err := parg(cmd, args); err != nil {
+ return err
+ }
+ }
+ return nil
+ }
+}