diff --git a/help.go b/help.go index 0a421ee99a..03cead43fc 100644 --- a/help.go +++ b/help.go @@ -164,9 +164,10 @@ func DefaultCompleteWithFlags(cmd *Command) func(c *Context) { if len(os.Args) > 2 { lastArg := os.Args[len(os.Args)-2] if strings.HasPrefix(lastArg, "-") { - printFlagSuggestions(lastArg, c.App.Flags, c.App.Writer) if cmd != nil { printFlagSuggestions(lastArg, cmd.Flags, c.App.Writer) + } else { + printFlagSuggestions(lastArg, c.App.Flags, c.App.Writer) } return }