From d643f7726b47ee1ea4913811ac5a72bab2a22830 Mon Sep 17 00:00:00 2001 From: Patrick McDermott Date: Wed, 21 Nov 2018 19:04:44 -0500 Subject: tools/shld.sh: Use parameters, not global variables --- diff --git a/tools/shld.sh b/tools/shld.sh index 2a5587c..41751d3 100755 --- a/tools/shld.sh +++ b/tools/shld.sh @@ -21,11 +21,6 @@ set -u VERSION='0.2.0' -output='out.sh' -make_executable=false -interpreter='/bin/sh' -entry_point='main' - die() { local fmt="${1}" @@ -37,6 +32,11 @@ die() link() { + local make_executable="${1}" + local interpreter="${2}" + local entry_point="${3}" + local output="${4}" + shift 4 local input= # Open output file. @@ -123,6 +123,12 @@ EOF main() { + local opt= + local make_executable=false + local interpreter='/bin/sh' + local entry_point='main' + local output='out.sh' + while getopts 'hVI:e:o:' opt; do case "${opt}" in 'h') @@ -153,7 +159,8 @@ main() exit 1 fi - link "${@}" + link "${make_executable}" "${interpreter}" "${entry_point}" \ + "${output}" "${@}" } main "${@}" -- cgit v0.9.1