diff options
Diffstat (limited to 'vendor/github.com/urfave/cli')
-rw-r--r-- | vendor/github.com/urfave/cli/app.go | 2 | ||||
-rw-r--r-- | vendor/github.com/urfave/cli/command.go | 1 | ||||
-rw-r--r-- | vendor/github.com/urfave/cli/context.go | 3 | ||||
-rw-r--r-- | vendor/github.com/urfave/cli/flag_int64_slice.go | 4 | ||||
-rw-r--r-- | vendor/github.com/urfave/cli/flag_int_slice.go | 4 | ||||
-rw-r--r-- | vendor/github.com/urfave/cli/flag_string_slice.go | 4 |
6 files changed, 11 insertions, 7 deletions
diff --git a/vendor/github.com/urfave/cli/app.go b/vendor/github.com/urfave/cli/app.go index ddb7685d62..382f238f49 100644 --- a/vendor/github.com/urfave/cli/app.go +++ b/vendor/github.com/urfave/cli/app.go @@ -263,8 +263,6 @@ func (a *App) Run(arguments []string) (err error) { if a.Before != nil { beforeErr := a.Before(context) if beforeErr != nil { - _, _ = fmt.Fprintf(a.Writer, "%v\n\n", beforeErr) - _ = ShowAppHelp(context) a.handleExitCoder(context, beforeErr) err = beforeErr return err diff --git a/vendor/github.com/urfave/cli/command.go b/vendor/github.com/urfave/cli/command.go index 24e9e5c572..f02d3589ff 100644 --- a/vendor/github.com/urfave/cli/command.go +++ b/vendor/github.com/urfave/cli/command.go @@ -161,7 +161,6 @@ func (c Command) Run(ctx *Context) (err error) { if c.Before != nil { err = c.Before(context) if err != nil { - _ = ShowCommandHelp(context, c.Name) context.App.handleExitCoder(context, err) return err } diff --git a/vendor/github.com/urfave/cli/context.go b/vendor/github.com/urfave/cli/context.go index 957f39e0f4..3adf37e7b2 100644 --- a/vendor/github.com/urfave/cli/context.go +++ b/vendor/github.com/urfave/cli/context.go @@ -324,11 +324,12 @@ func checkRequiredFlags(flags []Flag, context *Context) requiredFlagsErr { var flagPresent bool var flagName string for _, key := range strings.Split(f.GetName(), ",") { + key = strings.TrimSpace(key) if len(key) > 1 { flagName = key } - if context.IsSet(strings.TrimSpace(key)) { + if context.IsSet(key) { flagPresent = true } } diff --git a/vendor/github.com/urfave/cli/flag_int64_slice.go b/vendor/github.com/urfave/cli/flag_int64_slice.go index 2602408cf7..80772e7c2a 100644 --- a/vendor/github.com/urfave/cli/flag_int64_slice.go +++ b/vendor/github.com/urfave/cli/flag_int64_slice.go @@ -171,7 +171,9 @@ func lookupInt64Slice(name string, set *flag.FlagSet) []int64 { func removeFromInt64Slice(slice []int64, val int64) []int64 { for i, v := range slice { if v == val { - return append(slice[:i], slice[i+1:]...) + ret := append([]int64{}, slice[:i]...) + ret = append(ret, slice[i+1:]...) + return ret } } return slice diff --git a/vendor/github.com/urfave/cli/flag_int_slice.go b/vendor/github.com/urfave/cli/flag_int_slice.go index a423d1ecb8..af6d582deb 100644 --- a/vendor/github.com/urfave/cli/flag_int_slice.go +++ b/vendor/github.com/urfave/cli/flag_int_slice.go @@ -170,7 +170,9 @@ func lookupIntSlice(name string, set *flag.FlagSet) []int { func removeFromIntSlice(slice []int, val int) []int { for i, v := range slice { if v == val { - return append(slice[:i], slice[i+1:]...) + ret := append([]int{}, slice[:i]...) + ret = append(ret, slice[i+1:]...) + return ret } } return slice diff --git a/vendor/github.com/urfave/cli/flag_string_slice.go b/vendor/github.com/urfave/cli/flag_string_slice.go index c6cb442545..a7c71e9dcc 100644 --- a/vendor/github.com/urfave/cli/flag_string_slice.go +++ b/vendor/github.com/urfave/cli/flag_string_slice.go @@ -156,7 +156,9 @@ func lookupStringSlice(name string, set *flag.FlagSet) []string { func removeFromStringSlice(slice []string, val string) []string { for i, v := range slice { if v == val { - return append(slice[:i], slice[i+1:]...) + ret := append([]string{}, slice[:i]...) + ret = append(ret, slice[i+1:]...) + return ret } } return slice |