From 79a0486ec1f55c933a58819558b1d45998fa7ac4 Mon Sep 17 00:00:00 2001 From: Cody Boone Ferguson <53008573+xexyl@users.noreply.github.com> Date: Mon, 22 Jan 2024 04:36:08 -0800 Subject: [PATCH] Fix arg check in ioccc-status.sh It should be != 1 rather than -gt 1. Not having this meant that if no arg was specified the usage message was not printed and instead the arg of the status.json file (which was not given) was shown to not exist (because it was empty so not a file). --- bin/ioccc-status.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/bin/ioccc-status.sh b/bin/ioccc-status.sh index fd5949d96..42b84d2db 100755 --- a/bin/ioccc-status.sh +++ b/bin/ioccc-status.sh @@ -24,7 +24,7 @@ # # The -G option lets one set the path to grep(1). # -export IOCCC_STATUS_SCRIPT_VERSION="0.0.3-0 2024-01-15" # major.minor.release-patch YYYY-MM-DD +export IOCCC_STATUS_SCRIPT_VERSION="0.0.4-0 2024-01-22" # major.minor.release-patch YYYY-MM-DD SED="$(type -P sed)" GREP="$(type -P grep)" @@ -109,8 +109,9 @@ shift $(( OPTIND - 1 )); # verify arg count # -if [[ $# -gt 1 ]]; then +if [[ $# != 1 ]]; then echo "$0: ERROR: expected no more than 1 arg, found: $#" 1>&2 + echo 1>&2 echo "$USAGE" 1>&2 exit 3 fi