From 48f0e3101d49a3de1466ff75fc786ce012f369cc Mon Sep 17 00:00:00 2001 From: Marc Khouzam Date: Wed, 5 Jun 2019 22:09:15 -0400 Subject: [PATCH] Allow for completion of aliases Turns out that removing the quotes from the associate array 'aliashash' is still required, but because it is needed for completion of alias commands. For example helm dep does not complete as expected (as if it was 'helm dependency') if the quotes are not removed. This is because although bash ignores quotes when using associative arrays, zsh does not. So when looking for an alias aliashash[dep] will not match the entry aliashash["dep"] in zsh but will for bash. Therefore, removing the quotes fixes things. Signed-off-by: Marc Khouzam --- cmd/helm/completion.go | 1 + 1 file changed, 1 insertion(+) diff --git a/cmd/helm/completion.go b/cmd/helm/completion.go index f0345d32a..051f946fd 100644 --- a/cmd/helm/completion.go +++ b/cmd/helm/completion.go @@ -205,6 +205,7 @@ __helm_convert_bash_to_zsh() { -e "s/${LWORD}compopt${RWORD}/__helm_compopt/g" \ -e "s/${LWORD}declare${RWORD}/builtin declare/g" \ -e "s/\\\$(type${RWORD}/\$(__helm_type/g" \ + -e 's/aliashash\["\(.\{1,\}\)"\]/aliashash[\1]/g' \ -e 's/FUNCNAME/funcstack/g' \ <<'BASH_COMPLETION_EOF' `