Commit 8bf0f2d4 authored by Vitaly Lipatov's avatar Vitaly Lipatov

eget: add support for -O- and -O/dev/stdout

parent 1015878c
...@@ -156,12 +156,14 @@ __wget() ...@@ -156,12 +156,14 @@ __wget()
# put remote content to stdout # put remote content to stdout
scat() scat()
{ {
__wget $WGETNOSSLCHECK -O- "$1" __wget -O- "$1"
} }
# download to default name of to $2 # download to default name of to $2
sget() sget()
{ {
if [ -n "$2" ] ; then if [ "$2" = "/dev/stdout" ] || [ "$2" = "-" ] ; then
scat "$1"
elif [ -n "$2" ] ; then
docmd __wget -O "$2" "$1" docmd __wget -O "$2" "$1"
else else
# TODO: поддержка rsync для известных хостов? # TODO: поддержка rsync для известных хостов?
...@@ -191,7 +193,9 @@ scat() ...@@ -191,7 +193,9 @@ scat()
# download to default name of to $2 # download to default name of to $2
sget() sget()
{ {
if [ -n "$2" ] ; then if [ "$2" = "/dev/stdout" ] || [ "$2" = "-" ] ; then
scat "$1"
elif [ -n "$2" ] ; then
__curl --output "$2" "$1" __curl --output "$2" "$1"
else else
__curl $CURLNAMEOPTIONS "$1" __curl $CURLNAMEOPTIONS "$1"
...@@ -237,6 +241,9 @@ TARGETFILE='' ...@@ -237,6 +241,9 @@ TARGETFILE=''
if [ "$1" = "-O" ] ; then if [ "$1" = "-O" ] ; then
TARGETFILE="$2" TARGETFILE="$2"
shift 2 shift 2
elif [ "$1" = "-O-" ] ; then
TARGETFILE="-"
shift 1
fi fi
# TODO: # TODO:
......
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