From e448097581be68a6894d3294e8b0bc5d2ec327ef Mon Sep 17 00:00:00 2001 From: Yaro Kasear Date: Fri, 2 May 2025 16:11:03 -0500 Subject: [PATCH] Refactor argument parsing in runtest.sh to improve clarity and consistency --- runtest.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/runtest.sh b/runtest.sh index b88462e..6718968 100755 --- a/runtest.sh +++ b/runtest.sh @@ -8,8 +8,8 @@ NO_ENRICH=0 LISTENER_ENABLED=0 LISTENER_ARGS=() -for arg in "$@"; do - case $arg in +while [[ $# -gt 0 ]]; do + case "$1" in --no-enrich) NO_ENRICH=1 shift @@ -20,7 +20,7 @@ for arg in "$@"; do shift ;; --listener-channel=*) - LISTENER_ARGS+=("--channel" "${arg#*=}") + LISTENER_ARGS+=("--channel" "${1#*=}") shift ;; --listener-hop) @@ -28,7 +28,7 @@ for arg in "$@"; do shift ;; *) - echo "Unknown argument: $arg" + echo "Unknown argument: $1" exit 1 ;; esac