10 lines
296 B
Plaintext
10 lines
296 B
Plaintext
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
|