summaryrefslogtreecommitdiffstats
path: root/tools/shld.sh
diff options
context:
space:
mode:
Diffstat (limited to 'tools/shld.sh')
-rwxr-xr-xtools/shld.sh19
1 files changed, 13 insertions, 6 deletions
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 "${@}"