20 lines
427 B
Fish
Raw Normal View History

2013-05-18 01:29:21 +08:00
# gitignore.io cli for fish
#
function gi
#curl http://gitignore.io/api/$argv
set -l params (echo $argv|tr ' ' ',')
curl http://gitignore.io/api/$params
2013-05-18 01:29:21 +08:00
end
# enable the complation by invoking `gi list`
if not set -q -g gi_list
timeout 2 ping -c 1 -q gitignore.io >/dev/null
set gi_available $status
if test $gi_available
set -g gi_list (gi list| tr ',' ' ' ^/dev/null)
end
end
complete -c gi -a "$gi_list"