diff --git a/curl/upload/file/posix.tmpl.sh b/curl/upload/file/posix.tmpl.sh index efa7a3b65a53cd894cb8d31461401582aa8fdca8..0878ef9b2a2c771e9b96a7453d3ffe78ca339aa3 100644 --- a/curl/upload/file/posix.tmpl.sh +++ b/curl/upload/file/posix.tmpl.sh @@ -34,12 +34,17 @@ fi # Parse arguments ENDPOINT="${URL}" +DESTINATION="${DST}" while test 0 -ne "${#}"; do case "${1}" in "--url") shift ENDPOINT="${1?Must provide an argument for --url}" ;; + "--destination") + shift + DESTINATION="${1?Must provide an argument for --destination}" + ;; *) printf >&2 'Error: unknown argument: %s\n' "${1}" exit 2 @@ -47,9 +52,9 @@ while test 0 -ne "${#}"; do esac shift done -readonly ENDPOINT +readonly ENDPOINT DESTINATION -printf >&2 "Uploading: %s to %s\n" "${SRC}" "${ENDPOINT}/${DST}" +printf >&2 "Uploading: %s to %s\n" "${SRC}" "${ENDPOINT}/${DESTINATION}" # Do the upload "${RUNFILES}/${CURL}" \ @@ -59,4 +64,4 @@ printf >&2 "Uploading: %s to %s\n" "${SRC}" "${ENDPOINT}/${DST}" --retry "${RETRY}" \ --retry-delay "${RETRY_DELAY}" \ --upload-file "${RUNFILES}/${SRC}" \ - "${ENDPOINT}/${DST}" + "${ENDPOINT}/${DESTINATION}"