Shift by OPTIND-1 after parsing, instead of during.

This commit is contained in:
redxef 2023-06-08 01:13:26 +02:00
parent 35a4fa28f8
commit d8c6d40dd9
Signed by: redxef
GPG key ID: 7DAC3AA211CBD921
2 changed files with 2 additions and 2 deletions

View file

@ -125,7 +125,6 @@ while getopts "$short_options" arg; do
exit 1
fi
done
shift 2
;;
*)
echo "unknown option $1" >&2
@ -134,6 +133,8 @@ while getopts "$short_options" arg; do
esac
done
shift $((OPTIND-1))
case "$1" in
create)
shift

View file

@ -23,7 +23,6 @@ while getopts "$short_options" arg; do
case "$arg" in
s)
TARBACK_REMOTE="$OPTARG"
shift 2
;;
*)
echo "unknown option $1" >&2