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' ...@@ -285,6 +285,7 @@ CURLNAMEOPTIONS='--remote-name --remote-time --remote-header-name'
LISTONLY='' LISTONLY=''
CHECKURL='' CHECKURL=''
GETRESPONSE=''
GETFILENAME='' GETFILENAME=''
GETREALURL='' GETREALURL=''
GETIPFSCID='' GETIPFSCID=''
...@@ -323,6 +324,7 @@ Options: ...@@ -323,6 +324,7 @@ Options:
--list|--list-only - print only URLs --list|--list-only - print only URLs
--check URL - check if the URL is accessible (returns HTTP 200 OK) --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-filename URL - print filename for the URL (via Content-Disposition if applicable)
--get-real-url URL - print URL after all redirects --get-real-url URL - print URL after all redirects
...@@ -389,6 +391,9 @@ while [ -n "$1" ] ; do ...@@ -389,6 +391,9 @@ while [ -n "$1" ] ; do
--get-filename) --get-filename)
GETFILENAME="$1" GETFILENAME="$1"
;; ;;
--get-response)
GETRESPONSE="$1"
;;
--get-real-url) --get-real-url)
GETREALURL="$1" GETREALURL="$1"
;; ;;
...@@ -1220,6 +1225,11 @@ if [ -n "$CHECKURL" ] ; then ...@@ -1220,6 +1225,11 @@ if [ -n "$CHECKURL" ] ; then
exit exit
fi fi
if [ -n "$GETRESPONSE" ] ; then
url_get_response "$1"
exit
fi
# separate part for github downloads # separate part for github downloads
if echo "$1" | grep -q "^https://github.com/" && \ 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