+OUTPUTDIR="${HOME}/stable"
+SIGN="yes"
+VERBOSE=""
+
+usage() {
+ echo "Usage: do-release.sh [OPTION]... RELEASE"
+ echo
+ echo "Mandatory arguments to long options are mandatory for short options too."
+ echo " -s, --srcdir DIR source directory"
+ echo " -o, --outputdir DIR output directory, must exist"
+ echo " -n, --no-sign don't GPG sign the output archive"
+ echo " -v, --verbose verbose command output"
+}
+
+POS_ARGS=()
+while [[ $# -gt 0 ]]
+do
+ arg="$1"
+
+ case $arg in
+ -n|--no-sign)
+ SIGN="no"
+ shift 1
+ ;;
+
+ -s|--srcdir)
+ SRCDIR="$2"
+ shift 2
+ ;;
+
+ -o|--outputdir)
+ OUTPUTDIR="$2"
+ shift 2
+ ;;
+
+ -v|--verbose)
+ VERBOSE="-v"
+ shift 1
+ ;;
+
+ # Catch unknown arguments
+ -*)
+ usage
+ exit 1
+ ;;
+
+ *)
+ POS_ARGS+=("$1")
+ shift
+ ;;
+ esac
+done
+set -- "${POS_ARGS[@]}"