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

Fix flag completion #1438

Merged
merged 2 commits into from Jul 2, 2021
Merged

Fix flag completion #1438

merged 2 commits into from Jul 2, 2021

Commits on Jul 2, 2021

  1. Fix flag completion

    The flag completion functions should not be stored in the root cmd.
    There is no requirement that the root cmd should be the same when
    `RegisterFlagCompletionFunc` was called. Storing the flags there does
    not work when you add the the flags to your cmd struct before you add the
    cmd to the parent/root cmd. The flags can no longer be found in the rigth
    place when the completion command is called and thus the flag completion
    does not work.
    
    Also spf13#1423 claims that this would be thread safe but we still have a map
    which will fail when accessed concurrently. To truly fix this issue use a
    RWMutex.
    
    Fixes spf13#1437
    Fixes spf13#1320
    
    Signed-off-by: Paul Holzinger <pholzing@redhat.com>
    Luap99 committed Jul 2, 2021
    Copy the full SHA
    bd3c9ba View commit details
    Browse the repository at this point in the history
  2. Fix trailing whitespaces in fish comp scripts

    Signed-off-by: Paul Holzinger <pholzing@redhat.com>
    Luap99 committed Jul 2, 2021
    Copy the full SHA
    92df029 View commit details
    Browse the repository at this point in the history