cleanup some issues with error display
This commit is contained in:
parent
fdd4d10691
commit
f21b22dd90
2
app.go
2
app.go
@ -230,7 +230,6 @@ func (a *App) Run(arguments []string) (err error) {
|
||||
|
||||
cerr := checkRequiredFlags(a.Flags, set)
|
||||
if cerr != nil {
|
||||
fmt.Fprintln(a.Writer, cerr)
|
||||
ShowAppHelp(context)
|
||||
return cerr
|
||||
}
|
||||
@ -361,7 +360,6 @@ func (a *App) RunAsSubcommand(ctx *Context) (err error) {
|
||||
|
||||
cerr := checkRequiredFlags(a.Flags, set)
|
||||
if cerr != nil {
|
||||
fmt.Fprintln(a.Writer, cerr)
|
||||
ShowSubcommandHelp(context)
|
||||
return cerr
|
||||
}
|
||||
|
@ -137,7 +137,6 @@ func (c Command) Run(ctx *Context) (err error) {
|
||||
|
||||
cerr := checkRequiredFlags(c.Flags, set)
|
||||
if cerr != nil {
|
||||
fmt.Fprintln(context.App.Writer, cerr)
|
||||
ShowCommandHelp(context, c.Name)
|
||||
return cerr
|
||||
}
|
||||
|
@ -320,7 +320,7 @@ func checkRequiredFlags(flags []Flag, set *flag.FlagSet) requiredFlagsErr {
|
||||
if rf, ok := f.(RequiredFlag); ok && rf.IsRequired() {
|
||||
key := strings.Split(f.GetName(), ",")[0]
|
||||
if !visited[key] {
|
||||
missingFlags = append(missingFlags, f.GetName())
|
||||
missingFlags = append(missingFlags, key)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user