You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When a command sets DisableFlagParsing = true it requests the responsibility of doing all the flag parsing.
If there are flags for that command, Cobra may not even know about them.
I've seen this used to provide plugins to a Cobra-based CLI. The plugins must handle their own flags as the original CLI knows nothing about such flags.
The problem is that with #1813 the shell completion logic completes the --help/-h and --version/-v for all commands, even those that do their own flag handling (i.e., DisableFlagParsing == true). I've seen this cause the --help/-h be completed twice for plugins: one time from cobra and one time from the plugin.
I therefore feel that Cobra should not complete the --help/-h and --version/-v if DisableFlagParsing==true.