Add zsh and fish completion wrt #19

This commit is contained in:
2020-04-27 23:36:13 +02:00
parent 56c439d716
commit 640cf1e2c1
3 changed files with 51 additions and 0 deletions

14
shell-completions/bash Normal file
View File

@@ -0,0 +1,14 @@
_ghcup()
{
local CMDLINE
local IFS=$'\n'
CMDLINE=(--bash-completion-index $COMP_CWORD)
for arg in ${COMP_WORDS[@]}; do
CMDLINE=(${CMDLINE[@]} --bash-completion-word $arg)
done
COMPREPLY=( $(ghcup "${CMDLINE[@]}") )
}
complete -o filenames -F _ghcup ghcup