@ -1,50 +1,56 @@
#!/usr/bin/env bash
# Parse options
POSITIONAL=()
while [[ $# -gt 0 ]]
do
key="$1"
while [[ $# -gt 0 ]]; do
LOG=false
case $key in
--token)
TOKEN="$2"
shift # past argument
shift # past value
;;
--device)
DEVICE="$2"
--volume-name)
VOLUME_NAME="$2"
--volume-region)
VOLUME_REGION="$2"
--buffer)
BUFFER="$2"
--log)
LOG=true
*) # unknown option
POSITIONAL+=("$1") # save it in an array for later
esac
shift
*)
POSITIONAL+=("$1")
done
set -- "${POSITIONAL[@]}" # restore positional parameters
set -- "${POSITIONAL[@]}"
log () {
prefix=""