12 lines
312 B
Bash
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
|