Update bash-completion

这个提交包含在:
Julian Ospald 2020-04-26 23:32:13 +02:00
父节点 1d623723a2
当前提交 ed4ff15f96
找不到此签名对应的密钥
GPG 密钥 ID: 511B62C09D50CD28
共有 1 个文件被更改,包括 12 次插入9 次删除

查看文件

@ -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