]> Kevux Git Server - fll/commitdiff
Update: The generate unicode script to accept input file parameter.
authorKevin Day <Kevin@kevux.org>
Thu, 28 May 2026 22:31:38 +0000 (17:31 -0500)
committerKevin Day <Kevin@kevux.org>
Thu, 28 May 2026 22:31:38 +0000 (17:31 -0500)
build/scripts/generate_unicode.sh

index cb541ca3865d416feaf8f28f8928eb0cc057f2ae..0aa074ac4f70114edc98cba01df9574657288dd9 100644 (file)
@@ -5,9 +5,13 @@
 # A simple script for generating code regarding unicode values.
 # This requires the python "unicode" program.
 #
+# Paramters:
+#   1: mode.
+#   2: input file (optional).
+#
 # The following modes are supported:
-# - source: Generate C source code if condition blocks (default).
-# - test: Generate unit test byte data (in base 10) files.
+#   - source: Generate C source code if condition blocks (default).
+#   - test: Generate unit test byte data (in base 10) files.
 #
 
 main() {
@@ -29,6 +33,10 @@ main() {
   local u3=
   local -i i=0
 
+  if [[ ${2} != "" ]] ; then
+    file_input=${2}
+  fi
+
   if [[ ${mode} == "" ]] ; then
     mode=source
   elif [[ ! (${mode} == "source" || ${mode} == "test") ]] ; then
@@ -175,4 +183,4 @@ generate_test() {
   fi
 }
 
-main "${1}"
+main "${@}"