cobra
cobra copied to clipboard
fix: don't remove flag value that matches subcommand name
When the command searches args to find the arg matching a particular subcommand name, it needs to ignore flag values, as it is possible that the value for a flag might match the name of the sub command.
This change improves argsMinusFirstX() to ignore flag values when it searches for the X to exclude from the result.
Fixes #1777