From 75960ab56d57d278c72c64c7855faa14ebe9f380 Mon Sep 17 00:00:00 2001 From: hasecilu Date: Tue, 30 May 2023 23:45:53 -0600 Subject: [PATCH] Use first arguments as wrapping value. - Resistant to bad inputs. - First checks if argument is a number and then checks if its greater than 2, if it's, the `wrapAt` variable is updated. --- bin/scripts/test-fonts.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/bin/scripts/test-fonts.sh b/bin/scripts/test-fonts.sh index 4fe758200..6b55e4724 100755 --- a/bin/scripts/test-fonts.sh +++ b/bin/scripts/test-fonts.sh @@ -23,6 +23,7 @@ function print-decimal-unicode-range() { local allChars="" local allCodes="" local wrapAt=16 + [[ "$wrappingValue" =~ ^[0-9]+$ ]] && [ "$wrappingValue" -gt 2 ] && wrapAt="$wrappingValue" local topLineStart="${bgColorBorder}╔═══" local topLineMiddle="═══╦═══" local topLineEnd="═══╗${reset_color}" @@ -182,4 +183,6 @@ function test-fonts() { echo; echo } +wrappingValue="$1" + test-fonts