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

DisableFlagParsing must trigger custom completion for flag names #1161

Merged
merged 1 commit into from Nov 1, 2021

Commits on Jul 15, 2021

  1. DisableFlagParsing must disable flag completion

    When a command has set DisableFlagParsing=true, it means Cobra should
    not be handling flags for that command but should let the command
    handle them itself.  In fact, Cobra normally won't have been told at all
    about flags for this command.
    
    Not knowing about the flags of the command also implies that Cobra
    cannot perform flag completion as it does not have the necessary info.
    
    This commit still tries to do flag name completion, but when
    DisableFlagParsing==true, it continues on so that ValidArgsFunction will
    be called; this allows the program to handle completion for its own
    flags when DisableFlagParsing==true.
    
    Signed-off-by: Marc Khouzam <marc.khouzam@montreal.ca>
    marckhouzam committed Jul 15, 2021
    Copy the full SHA
    cae6c02 View commit details
    Browse the repository at this point in the history