From 3402788d354484587db080c5227b37e824a3c443 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 22 Dec 2025 21:31:43 -0800 Subject: [PATCH] ... --- ebook2audiobook.sh | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/ebook2audiobook.sh b/ebook2audiobook.sh index db08cde0..2da1e03b 100755 --- a/ebook2audiobook.sh +++ b/ebook2audiobook.sh @@ -71,12 +71,14 @@ while (( $# > 0 )); do case "$1" in --*) key="${1#--}" - if [[ -n "${2}:-" && "$2" != --* ]]; then - arguments[$key]="$2" + if (( $# > 1 )) && [[ "$2" != --* ]]; then + arguments["$key"]="$2" shift 2 continue else - arguments[$key]=true + arguments["$key"]=true + shift + continue fi ;; *) @@ -84,9 +86,9 @@ while (( $# > 0 )); do exit 1 ;; esac - shift done + if [[ -n "${arguments[script_mode]+exists}" ]]; then if [[ "${arguments[script_mode]}" == "$BUILD_DOCKER" ]]; then SCRIPT_MODE="${arguments[script_mode]}"