2013-05-17 17:29:21 +00:00
|
|
|
# gitignore.io cli for fish
|
|
|
|
|
|
|
|
function gi
|
2013-06-18 19:03:58 +00:00
|
|
|
#curl http://gitignore.io/api/$argv
|
2013-11-20 09:53:39 +00:00
|
|
|
set -l params (echo $argv|tr ' ' ',')
|
|
|
|
curl http://gitignore.io/api/$params
|
2013-05-17 17:29:21 +00:00
|
|
|
end
|
2013-06-18 19:03:58 +00:00
|
|
|
|
|
|
|
# enable the complation by invoking `gi list`
|
|
|
|
if not set -q -g gi_list
|
2013-11-20 09:53:39 +00:00
|
|
|
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
|
2013-06-18 19:03:58 +00:00
|
|
|
end
|
|
|
|
|
2013-11-20 09:53:39 +00:00
|
|
|
complete -c gi -a "$gi_list"
|