Skip to content

Commit 2ad31f5

Browse files
authored
Fix --status-disable and --status-enable (#1947)
1 parent 1797e64 commit 2ad31f5

File tree

1 file changed

+16
-3
lines changed

1 file changed

+16
-3
lines changed

main.sh

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -438,6 +438,22 @@ cmdline() {
438438
exit 1
439439
fi
440440
;;
441+
status-*)
442+
if [[ -n ${!OPTIND-} ]]; then
443+
readonly STATUSMETHOD=${OPTION}
444+
local MULTIOPT
445+
MULTIOPT=("$OPTARG")
446+
until [[ -z ${!OPTIND-} || ${!OPTIND} =~ ^-.* ]]; do
447+
MULTIOPT+=("${!OPTIND}")
448+
OPTIND=$((OPTIND + 1))
449+
done
450+
STATUS=$(printf "%s " "${MULTIOPT[@]}" | xargs)
451+
readonly STATUS
452+
else
453+
error "${OPTION} requires an option."
454+
exit 1
455+
fi
456+
;;
441457
status)
442458
if [[ -n ${!OPTIND-} ]]; then
443459
OPTARG="${!OPTIND}"
@@ -460,9 +476,6 @@ cmdline() {
460476
exit 1
461477
fi
462478
;;
463-
status-*)
464-
readonly STATUSMETHOD=${OPTION}
465-
;;
466479
test)
467480
if [[ -n ${!OPTIND-} ]]; then
468481
OPTARG="${!OPTIND}"

0 commit comments

Comments
 (0)