Add consistency to variable naming, using lowercase for non-exported variables and uppercase for expoered ine. Also made some grammar fixes and removed 'short' since it's not available yet.

This commit is contained in:
Sam Hardeman 2025-11-23 16:51:15 +01:00
parent 8f9bdfbb30
commit 405c1e7244
5 changed files with 59 additions and 80 deletions

40
binbox
View file

@ -6,7 +6,7 @@
DAISY_INTERNAL=1
. $(dirname $(realpath $0))/daisy.source
ARGS=$@
args=$@
function help()
{
@ -26,20 +26,20 @@ if [[ $@ == '' ]]; then
fi
# Define some building blocks
CASE_P1="case $BINARY in"
CASE_PM1=" $OPTION)"
CASE_PM2=" exec $OTPION_fn"
CASE_PM3=" ;;"
CASE_CM1=" *)"
CASE_CM2=" exec help_fn"
CASE_CM3=" ;;"
CASE_P2="esac"
case_p1="case $BINARY in"
case_pm1=" $OPTION)"
case_pm2=" exec $OTPION_fn"
case_pm3=" ;;"
case_cm1=" *)"
case_cm2=" exec help_fn"
case_cm3=" ;;"
case_p2="esac"
FUNC_P1="function $OPTION_fn() {"
FUNC_P2=" exit($?)"
FUNC_P3="}"
func_p1="function $OPTION_fn() {"
func_p2=" exit($?)"
func_p3="}"
BASIC_P1="BINARY=$0"
basic_p1="BINARY=$0"
# Start parsing args
inputs=()
@ -146,11 +146,11 @@ for f in "${inputs[@]}"; do
done
# >>> Section 3: Module selection
add "SYMED=1"
add "BINSELF=\$(basename \$0)"
add "BOXFILE=\"$output\""
add "if [[ \$BINSELF == \$BOXFILE ]]; then"
add " SYMED=0"
add "symed=1"
add "binself=\$(basename \$0)"
add "boxfile=\"$output\""
add "if [[ \$binself == \$boxfile ]]; then"
add " symed=0"
add " if [[ \$# -eq 0 ]]; then"
add " echo 'Available modules:'"
for f in "${inputs[@]}"; do
@ -160,12 +160,12 @@ add " exit 0"
add " fi"
add "fi"
add "if [[ \$SYMED -eq 0 ]]; then"
add "if [[ \$symed -eq 0 ]]; then"
add " eval \$@"
add " exit \$?"
add "fi"
add "if [[ \$SYMED -eq 1 ]]; then"
add "if [[ \$symed -eq 1 ]]; then"
add " eval \$(basename \$0) \$@"
add "fi"