.dotfiles/.local/share/bash-completion/completions/gi
2025-01-30 13:55:36 +00:00

12 lines
312 B
Bash

# vim: ft=bash
function _gi() {
cache="/tmp/${FUNCNAME[0]}"
if ! [ -f "$cache" ]; then
curl -sfL https://www.toptal.com/developers/gitignore/api/list | tr ',' '\n' > "$cache"
fi
mapfile -t COMPREPLY < <(compgen -W "$(cat "$cache")" -- "${COMP_WORDS[$COMP_CWORD]}")
}
complete -F _gi gi