Update bash-completion
This commit is contained in:
parent
1d623723a2
commit
ed4ff15f96
@ -1,11 +1,14 @@
|
|||||||
_ghcup()
|
_ghcup()
|
||||||
{
|
{
|
||||||
local cur
|
local CMDLINE
|
||||||
COMPREPLY=()
|
local IFS=$'\n'
|
||||||
cur="${COMP_WORDS[COMP_CWORD]}"
|
CMDLINE=(--bash-completion-index $COMP_CWORD)
|
||||||
if [[ ${#COMP_WORDS[*]} -le 2 ]]; then
|
|
||||||
COMPREPLY=($(compgen -W "$(ghcup --list-commands)" -- $cur))
|
for arg in ${COMP_WORDS[@]}; do
|
||||||
fi
|
CMDLINE=(${CMDLINE[@]} --bash-completion-word $arg)
|
||||||
return 0
|
done
|
||||||
} &&
|
|
||||||
complete -F _ghcup ghcup
|
COMPREPLY=( $(ghcup "${CMDLINE[@]}") )
|
||||||
|
}
|
||||||
|
|
||||||
|
complete -o filenames -F _ghcup ghcup
|
||||||
|
Loading…
Reference in New Issue
Block a user