Commit cf13084b authored by Vitaly Lipatov's avatar Vitaly Lipatov

eget: add --get-response

parent 5f5ef795
......@@ -285,6 +285,7 @@ CURLNAMEOPTIONS='--remote-name --remote-time --remote-header-name'
LISTONLY=''
CHECKURL=''
GETRESPONSE=''
GETFILENAME=''
GETREALURL=''
GETIPFSCID=''
......@@ -323,6 +324,7 @@ Options:
--list|--list-only - print only URLs
--check URL - check if the URL is accessible (returns HTTP 200 OK)
--get-response URL - get response with all headers (ever if HEAD is not acceptable)
--get-filename URL - print filename for the URL (via Content-Disposition if applicable)
--get-real-url URL - print URL after all redirects
......@@ -389,6 +391,9 @@ while [ -n "$1" ] ; do
--get-filename)
GETFILENAME="$1"
;;
--get-response)
GETRESPONSE="$1"
;;
--get-real-url)
GETREALURL="$1"
;;
......@@ -1220,6 +1225,11 @@ if [ -n "$CHECKURL" ] ; then
exit
fi
if [ -n "$GETRESPONSE" ] ; then
url_get_response "$1"
exit
fi
# separate part for github downloads
if echo "$1" | grep -q "^https://github.com/" && \
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment