Add basic bash-completion wrt #109

This commit is contained in:
2019-07-24 16:53:15 +08:00
parent 1b719ead22
commit 580da22569
2 changed files with 23 additions and 0 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