Fix flag completion (#1438)
Before adoption: this commit came in with the history the project adopted, so no landing records it.
* 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 #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 #1437 Fixes #1320 Signed-off-by: Paul Holzinger <pholzing@redhat.com> * Fix trailing whitespaces in fish comp scripts
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Trailers
- Signed-off-by: Paul Holzinger <pholzing@redhat.com>
Diff stats
5 files+54 added−13 removed
- other:+54 added−13 removed