If a quoted string starts with a hyphen and a space, the character following the space is interpreted as a flag. For example some-command '- http' is interpreted as some-command -h and shows help information for the command.
If FParseErrWhitelist.UnknownFlags is set to false, an error is displayed which implies the space is being interpreted as a flag as well:
Error: unknown shorthand flag: ' ' in - h
I don't think whitespace is a valid flag name so this seems like a bug to me. It can likely be avoided with a simple condition in the flag parsing:
- For
'- ', if unicode.IsSpace(rune(arg[1])), treat it as an argument
- For
'-- ', if unicode.IsSpace(rune(arg[2])), treat it as an argument
See ddev/ddev#7409 for additional context.
Related issue: #1733