Browse Source

Add basic bash-completion wrt #109

PR/133
Julian Ospald 4 years ago
parent
commit
580da22569
No known key found for this signature in database GPG Key ID: 511B62C09D50CD28
2 changed files with 23 additions and 0 deletions
  1. +11
    -0
      .bash-completion
  2. +12
    -0
      ghcup

+ 11
- 0
.bash-completion 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

+ 12
- 0
ghcup View File

@@ -2049,6 +2049,18 @@ while [ $# -gt 0 ] ; do
-V|--version)
printf "%s\\n" "${VERSION}"
exit 0;;
--list-commands)
echo "changelog
compile
debug-info
install
install-cabal
list
print-system-reqs
rm
set
upgrade"
exit 0;;
-h|--help)
usage;;
-w|--wget)


Loading…
Cancel
Save