From 61b94452e7345d7b4452318bc2027958f7ca9b87 Mon Sep 17 00:00:00 2001 From: ale5000 <15793015+ale5000-git@users.noreply.github.com> Date: Mon, 21 Oct 2024 17:45:35 +0200 Subject: [PATCH] Update bits-info.sh --- tools/bits-info.sh | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/tools/bits-info.sh b/tools/bits-info.sh index 9bbdf993..0ff70ce1 100755 --- a/tools/bits-info.sh +++ b/tools/bits-info.sh @@ -6,12 +6,8 @@ # shellcheck disable=SC3043 # In POSIX sh, local is undefined SCRIPT_NAME='Bits info' -SCRIPT_VERSION='1.5.3' +SCRIPT_VERSION='1.5.4' -echo '===' -command 1> /dev/null -v 'command'; echo $? -command 1> /dev/null -v ':'; echo $? -echo '===' ### CONFIGURATION ### set -u 2> /dev/null || : @@ -20,7 +16,7 @@ case "$(set 2> /dev/null -o || set || :)" in *'pipefail'*) set -o pipefail || pr # The "obosh" shell does NOT support "command" while the "posh" shell does NOT support "type" { - command 1> /dev/null -v 'command' + command 1> /dev/null -v ':' } 2> /dev/null || command() { test "${1-}" = '-v' || exit 255 @@ -1037,7 +1033,11 @@ while test "${#}" -gt 0; do printf '\n%s\n\n' 'Coming soon...' - if test -z "${0}" || ! script_filename="$(basename "${0}")"; then exit 1; fi + if test -n "${0-}" && script_filename="$(basename "${0}")"; then + : + else + exit 1 + fi printf '%s\n' 'Notes:' printf '%s\n' 'If a single parameter is given, then it returns the specific error code, otherwise if there are multiple files, it returns the number of files that were not recognized.'