Commit 40068977 authored by Vitaly Lipatov's avatar Vitaly Lipatov

eget: add support for EGET_OPTIONS

parent e846f47e
...@@ -406,6 +406,8 @@ Supported URLs: ...@@ -406,6 +406,8 @@ Supported URLs:
Supported backends (set like EGET_BACKEND=curl) Supported backends (set like EGET_BACKEND=curl)
wget curl (todo: aria2c) wget curl (todo: aria2c)
Also you can set EGET_OPTIONS variable with needed options
Examples: Examples:
$ eget http://ftp.somesite.ru/package-*.x64.tar $ eget http://ftp.somesite.ru/package-*.x64.tar
$ eget http://ftp.somesite.ru/package *.tar $ eget http://ftp.somesite.ru/package *.tar
...@@ -425,7 +427,9 @@ if [ -z "$1" ] ; then ...@@ -425,7 +427,9 @@ if [ -z "$1" ] ; then
exit 1 exit 1
fi fi
__eget_parse_options()
{
local skipopt=0
while [ -n "$1" ] ; do while [ -n "$1" ] ; do
argument="$(echo $1 | cut -d= -f1)" argument="$(echo $1 | cut -d= -f1)"
...@@ -577,12 +581,17 @@ while [ -n "$1" ] ; do ...@@ -577,12 +581,17 @@ while [ -n "$1" ] ; do
fatal "Unknown option '$1', check eget --help." fatal "Unknown option '$1', check eget --help."
;; ;;
*) *)
break return $skipopt
;; ;;
esac esac
shift shift
skipopt=$(($skipopt+1))
done done
}
__eget_parse_options "$@"
shift $?
__eget_parse_options $EGET_OPTIONS
#############################3 #############################3
# defaults # defaults
......
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