mirror of
https://github.com/lobaro/restic-backup-docker.git
synced 2026-11-14 07:52:44 +00:00
fix: reject --suite without a value instead of running all suites
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
4a2b963fb5
commit
76975658a7
1 file changed
+9
-2
+9
-2
@@ -36,8 +36,15 @@ while [ $# -gt 0 ]; do
|
||||
case "$1" in
|
||||
--no-build) BUILD=0 ;;
|
||||
--sabotage) SABOTAGE=1 ;;
|
||||
--suite) ONLY_SUITE="${2:-}"; shift ;;
|
||||
--suite=*) ONLY_SUITE="${1#--suite=}" ;;
|
||||
--suite)
|
||||
# A missing value, or a following flag, must not be taken as one.
|
||||
case "${2:-}" in
|
||||
""|-*) echo "--suite requires a value (compat|features|structure)" >&2; exit 2 ;;
|
||||
esac
|
||||
ONLY_SUITE="$2"; shift ;;
|
||||
--suite=*)
|
||||
ONLY_SUITE="${1#--suite=}"
|
||||
[ -n "$ONLY_SUITE" ] || { echo "--suite requires a value (compat|features|structure)" >&2; exit 2; } ;;
|
||||
-h|--help) sed -n '2,14p' "$0" | sed 's/^# \{0,1\}//'; exit 0 ;;
|
||||
*) echo "unknown argument: $1" >&2; exit 2 ;;
|
||||
esac
|
||||
|
||||
Reference in new issue
Block a user