diff --git a/enabler/commands/enabler_completion.sh b/enabler/commands/enabler_completion.sh new file mode 100755 index 0000000..b761d59 --- /dev/null +++ b/enabler/commands/enabler_completion.sh @@ -0,0 +1,55 @@ +_enabler_complete() { + local cur_word prev_word commands + + # Get the current and previous words + cur_word="${COMP_WORDS[COMP_CWORD]}" + prev_word="${COMP_WORDS[COMP_CWORD-1]}" + local categories="apps kind preflight platform setup version" + + case "$prev_word" in + "enabler") # noqa + commands="$categories" + ;; + esac + + # Initialize the variable to store previous words + prev_words="" + local apps="namespace" + local kind="create delete status start stop" + local platform="init info keys release version" + local setup="init metallb istio" + + # Loop through previous words and concatenate them + for ((i=1; i