migrate to dotter
This commit is contained in:
parent
c5618f2f2c
commit
23b6c0a596
265 changed files with 62 additions and 3125 deletions
19
configs/fish/functions/curl.fish
Normal file
19
configs/fish/functions/curl.fish
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
function http --argument-names method url --description "Curl wrapper with cache options"
|
||||
|
||||
argparse h/help c/cache '#cache_time' -- $argv
|
||||
or return
|
||||
|
||||
# If -h or --help is given, we print a little help text and return
|
||||
if set -ql _flag_help
|
||||
echo "http [-h|--help] [-s|--second] METHOD URL"
|
||||
return 0
|
||||
end
|
||||
|
||||
if set -ql _flag_cache
|
||||
mkdir -p /tmp/fish_http
|
||||
|
||||
curl -SsL -X (string upper $method) $url | tee /tmp/fish_http/(string escape --style=url $url)
|
||||
else
|
||||
curl -X (string upper $method) $url
|
||||
end
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue