Add bash-completion

This commit is contained in:
2020-04-22 20:12:57 +02:00
parent 5edebd57d9
commit e1b5a89cee
3 changed files with 24 additions and 1 deletions

11
.bash-completion Normal file
View File

@@ -0,0 +1,11 @@
_ghcup()
{
local cur
COMPREPLY=()
cur="${COMP_WORDS[COMP_CWORD]}"
if [[ ${#COMP_WORDS[*]} -le 2 ]]; then
COMPREPLY=($(compgen -W "$(ghcup --list-commands)" -- $cur))
fi
return 0
} &&
complete -F _ghcup ghcup