From 1d6dab2107dd4cf7bf5955161da45e72c2527684 Mon Sep 17 00:00:00 2001 From: Salt Date: Mon, 1 Mar 2021 14:53:19 -0600 Subject: [PATCH] Add automatic kubectl completion --- base/.profile | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/base/.profile b/base/.profile index 7d529073..060bb9c2 100755 --- a/base/.profile +++ b/base/.profile @@ -81,6 +81,19 @@ if has pip; then ;; esac fi +if has kubectl; then + case "$_baseshell" in + *bash) + if ! [ -f "$HOME/.kubectl-completion-bash" ]; then + kubectl completion bash > "$HOME/.kubectl-completion-bash" + echo ".profile: Created kubectl completion for bash" + fi + . "$HOME/.kubectl-completion-bash" + ;; + *) + ;; + esac +fi # Set up go, if we have it if has go; then