Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't complete --help flag when flag parsing disabled #2061

Merged
merged 1 commit into from
Oct 28, 2023

Commits on Oct 27, 2023

  1. Don't complete --help flag when flag parsing disabled

    Fixes spf13#2060
    
    When a command sets `DisableFlagParsing = true` it requests the
    responsibility of doing all the flag parsing. Therefore even the
    `--help/-f/--version/-v` flags should not be automatically completed
    by Cobra in such a case.
    
    Without this change the `--help/-h/--version/-v` flags can end up being
    completed twice for plugins: one time from cobra and one time from the
    plugin (which has set `DisableFlagParsing = true`).
    
    Signed-off-by: Marc Khouzam <marc.khouzam@gmail.com>
    marckhouzam committed Oct 27, 2023
    Configuration menu
    Copy the full SHA
    d54a5ab View commit details
    Browse the repository at this point in the history