mirror of
https://gitea.com/Lydanne/buildx.git
synced 2025-07-09 21:17:09 +08:00
vendor: update docker/cli to f1615fa
also needs to update docker/docker to a60b458 (22.06 branch) otherwise build breaks since docker/cli#3512 with: # github.com/docker/cli/cli/flags vendor/github.com/docker/cli/cli/flags/common.go:40:37: undefined: client.EnvOverrideCertPath vendor/github.com/docker/cli/cli/flags/common.go:41:37: undefined: client.EnvTLSVerify vendor/github.com/docker/cli/cli/flags/common.go:89:76: undefined: client.EnvOverrideHost needs also to update github.com/spf13/cobra to v1.5.0 otherwise build breaks with: # github.com/docker/cli/cli-plugins/plugin vendor/github.com/docker/cli/cli-plugins/plugin/plugin.go:130:4: unknown field 'HiddenDefaultCmd' in struct literal of type cobra.CompletionOptions Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
This commit is contained in:
26
vendor/github.com/spf13/cobra/command.go
generated
vendored
26
vendor/github.com/spf13/cobra/command.go
generated
vendored
@ -18,6 +18,7 @@ package cobra
|
||||
import (
|
||||
"bytes"
|
||||
"context"
|
||||
"errors"
|
||||
"fmt"
|
||||
"io"
|
||||
"os"
|
||||
@ -166,7 +167,7 @@ type Command struct {
|
||||
// errWriter is a writer defined by the user that replaces stderr
|
||||
errWriter io.Writer
|
||||
|
||||
//FParseErrWhitelist flag parse errors to be ignored
|
||||
// FParseErrWhitelist flag parse errors to be ignored
|
||||
FParseErrWhitelist FParseErrWhitelist
|
||||
|
||||
// CompletionOptions is a set of options to control the handling of shell completion
|
||||
@ -224,12 +225,23 @@ type Command struct {
|
||||
SuggestionsMinimumDistance int
|
||||
}
|
||||
|
||||
// Context returns underlying command context. If command wasn't
|
||||
// executed with ExecuteContext Context returns Background context.
|
||||
// Context returns underlying command context. If command was executed
|
||||
// with ExecuteContext or the context was set with SetContext, the
|
||||
// previously set context will be returned. Otherwise, nil is returned.
|
||||
//
|
||||
// Notice that a call to Execute and ExecuteC will replace a nil context of
|
||||
// a command with a context.Background, so a background context will be
|
||||
// returned by Context after one of these functions has been called.
|
||||
func (c *Command) Context() context.Context {
|
||||
return c.ctx
|
||||
}
|
||||
|
||||
// SetContext sets context for the command. It is set to context.Background by default and will be overwritten by
|
||||
// Command.ExecuteContext or Command.ExecuteContextC
|
||||
func (c *Command) SetContext(ctx context.Context) {
|
||||
c.ctx = ctx
|
||||
}
|
||||
|
||||
// SetArgs sets arguments for the command. It is set to os.Args[1:] by default, if desired, can be overridden
|
||||
// particularly useful when testing.
|
||||
func (c *Command) SetArgs(a []string) {
|
||||
@ -852,6 +864,10 @@ func (c *Command) execute(a []string) (err error) {
|
||||
if err := c.validateRequiredFlags(); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := c.validateFlagGroups(); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if c.RunE != nil {
|
||||
if err := c.RunE(c, argWoFlags); err != nil {
|
||||
return err
|
||||
@ -975,7 +991,7 @@ func (c *Command) ExecuteC() (cmd *Command, err error) {
|
||||
if err != nil {
|
||||
// Always show help if requested, even if SilenceErrors is in
|
||||
// effect
|
||||
if err == flag.ErrHelp {
|
||||
if errors.Is(err, flag.ErrHelp) {
|
||||
cmd.HelpFunc()(cmd, args)
|
||||
return cmd, nil
|
||||
}
|
||||
@ -997,7 +1013,7 @@ func (c *Command) ExecuteC() (cmd *Command, err error) {
|
||||
|
||||
func (c *Command) ValidateArgs(args []string) error {
|
||||
if c.Args == nil {
|
||||
return nil
|
||||
return ArbitraryArgs(c, args)
|
||||
}
|
||||
return c.Args(c, args)
|
||||
}
|
||||
|
Reference in New Issue
Block a user