Skip to content

Commit

Permalink
Allow for completion of aliases
Browse files Browse the repository at this point in the history
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 <TAB>
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 <marc.khouzam@ville.montreal.qc.ca>
  • Loading branch information
marckhouzam committed Jun 6, 2019
1 parent 0239cc4 commit 48f0e31
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions cmd/helm/completion.go
Original file line number Diff line number Diff line change
Expand Up @@ -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'
`
Expand Down

0 comments on commit 48f0e31

Please sign in to comment.