commit de9bfe528565e8074ae67514ca6f3512aae41b67 from: Omar Polo date: Sun Jan 08 18:00:16 2023 UTC util/got-build-regress.sh: switch from getopt(1) to getopts ok stsp@ commit - 6b5e61245844733fe2df78892399d5956f422311 commit + de9bfe528565e8074ae67514ca6f3512aae41b67 blob - 82afa2028dd0be74054dd2348115d8cc87611e14 blob + ecad672dd9987061ffe33a14f45c754453877ea2 --- util/got-build-regress.sh +++ util/got-build-regress.sh @@ -22,30 +22,24 @@ fromaddr_arg= force=0 testroot="/tmp" -args=`getopt b:fR:r:w: $*` -if [ $? -ne 0 ] -then - echo "usage: $usage" >&2 - exit 1 -fi -set -- $args -while [ $# -ne 0 ]; do - case "$1" - in - -b) - branch="$2"; shift; shift;; - -f) - force=1; shift;; - -w) - worktree="$2"; shift; shift;; - -r) - fromaddr_arg="-r $2"; shift; shift;; - -R) - testroot="$2"; shift; shift;; - --) - shift; break;; +while getopts b:fR:r:w: arg; do + case $arg in + b) + branch="$OPTARG" ;; + f) + force=1 ;; + w) + worktree="$OPTARG" ;; + r) + fromaddr_arg="-r $OPTARG" ;; + R) + testroot="$OPTARG" ;; + ?) + echo "usage: $usage" >&2 + exit 1 ;; esac done +shift $(($OPTIND - 1)) recipients="$@" if [ -z "$recipients" ]; then