-
Notifications
You must be signed in to change notification settings - Fork 3k
Closed
Description
I seem to have run into a bug that surfaces when you pass a value into a flag that matches the name of a subcommand. For example, suppose you have a command like this:
tester --project configs --config dev configs
where configs is a subcommand, but we're also passing that in as the value to the --project flag. In that scenario, the value for project ends up being --config and the value for config ends up being empty. If you change the value being passed to --project to anything else, it works fine. It also starts working fine if you leave the value being passed to --project as is, but rename the subcommand.
Here's video demonstrating the issue:
https://www.loom.com/share/22d1caba74644c939e978fd3277a437d
And here's the sample code demonstrating the problem: cobra-tester.zip
Metadata
Metadata
Assignees
Labels
No labels