From 69f9e98e61b2c80a1eca17f5908fb8df664666ba Mon Sep 17 00:00:00 2001 From: ADAM David Alan Martin Date: Sat, 4 Jun 2022 23:42:02 -0400 Subject: [PATCH] Turn the main engine into a function. --- bin/__build_sgr_code | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/bin/__build_sgr_code b/bin/__build_sgr_code index 74d9f14..a766c26 100755 --- a/bin/__build_sgr_code +++ b/bin/__build_sgr_code @@ -352,10 +352,8 @@ function named_color() rgb_color ${mapped} } -output="" - -while [[ ! -z $1 ]] -do +function build_sgr_code() +{ case $1 in dump-colors) dump_colors ;; @@ -399,6 +397,12 @@ do output="${output};" fi output="${output}${next}" +} + +output="" +while [[ ! -z $1 ]] +do + build_sgr_code $1 shift 1 done