cobra
cobra copied to clipboard
Unknown flags are parsed before unknown commands
If your CLI supports cli foo --bar
and you type cli fooo --bar
, you get an error that the flag is unknown. In reality, the command is unknown, so the error message is somewhat confusing for a user, especially since this also prevents the usual command suggestions from being printed (if, e.g., you type cli fooo
instead).