Created
September 3, 2015 20:36
-
-
Save eparis/fd17b8fb4eb58efc2c12 to your computer and use it in GitHub Desktop.
Patch to make bash completions work on Macs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/contrib/completions/bash/kubectl b/contrib/completions/bash/kubectl | |
index c096937..8bc3410 100644 | |
--- a/contrib/completions/bash/kubectl | |
+++ b/contrib/completions/bash/kubectl | |
@@ -1,5 +1,10 @@ | |
#!/bin/bash | |
+__my_init_completion() | |
+{ | |
+ COMPREPLY=() | |
+ _get_comp_words_by_ref cur prev words cword | |
+} | |
__debug() | |
{ | |
@@ -1180,7 +1185,11 @@ _kubectl() | |
__start_kubectl() | |
{ | |
local cur prev words cword | |
- _init_completion -s || return | |
+ if declare -F _init_completions >/dev/null 2>&1; then | |
+ _init_completion | |
+ else | |
+ __my_init_completion | |
+ fi | |
local c=0 | |
local flags=() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment