|
@@ -21,15 +21,16 @@ set -e
|
|
|
|
|
|
main() {
|
|
main() {
|
|
local OPT OPTARG
|
|
local OPT OPTARG
|
|
- local backend output hfile quiet
|
|
|
|
|
|
+ local backend output hfile recurse quiet
|
|
|
|
|
|
# Parse our options; anything after '--' is for the backend
|
|
# Parse our options; anything after '--' is for the backend
|
|
- while getopts :hb:o:H:q OPT; do
|
|
|
|
|
|
+ while getopts :hb:o:H:rq OPT; do
|
|
case "${OPT}" in
|
|
case "${OPT}" in
|
|
h) help; exit 0;;
|
|
h) help; exit 0;;
|
|
b) backend="${OPTARG}";;
|
|
b) backend="${OPTARG}";;
|
|
o) output="${OPTARG}";;
|
|
o) output="${OPTARG}";;
|
|
H) hfile="${OPTARG}";;
|
|
H) hfile="${OPTARG}";;
|
|
|
|
+ r) recurse="-r";;
|
|
q) quiet="-q";;
|
|
q) quiet="-q";;
|
|
:) error "option '%s' expects a mandatory argument\n" "${OPTARG}";;
|
|
:) error "option '%s' expects a mandatory argument\n" "${OPTARG}";;
|
|
\?) error "unknown option '%s'\n" "${OPTARG}";;
|
|
\?) error "unknown option '%s'\n" "${OPTARG}";;
|
|
@@ -82,7 +83,7 @@ main() {
|
|
# If the backend fails, we can just remove the temporary directory to
|
|
# If the backend fails, we can just remove the temporary directory to
|
|
# remove all the cruft it may have left behind. Then we just exit in
|
|
# remove all the cruft it may have left behind. Then we just exit in
|
|
# error too.
|
|
# error too.
|
|
- if ! "${OLDPWD}/support/download/${backend}" ${quiet} "${tmpf}" "${@}"; then
|
|
|
|
|
|
+ if ! "${OLDPWD}/support/download/${backend}" ${quiet} ${recurse} "${tmpf}" "${@}"; then
|
|
rm -rf "${tmpd}"
|
|
rm -rf "${tmpd}"
|
|
exit 1
|
|
exit 1
|
|
fi
|
|
fi
|