diff --git a/help.go b/help.go index 241c2744a4..ec1469c5cc 100644 --- a/help.go +++ b/help.go @@ -191,8 +191,7 @@ func cliArgContains(flagName string, args []string) bool { func printFlagSuggestions(lastArg string, flags []Flag, writer io.Writer) { // Trim the prefix twice to handle both "-short" and "--long" flags. - cur := strings.TrimPrefix(lastArg, "-") - cur = strings.TrimPrefix(cur, "-") + cur := strings.TrimLeft(lastArg, "-") for _, flag := range flags { if bflag, ok := flag.(*BoolFlag); ok && bflag.Hidden { continue