From 2628a25901d35bd267fba945100864578f920770 Mon Sep 17 00:00:00 2001 From: Francis Rowe Date: Thu, 10 Mar 2016 14:19:57 -0500 Subject: build: re-introduce variable names for $1 and $2 This is necessary, so that we can use "shift 2", so that additional parameters can be added which are passed to the scripts that the build script then calls. --- (limited to 'build') diff --git a/build b/build index f1b9472..069d652 100755 --- a/build +++ b/build @@ -63,25 +63,28 @@ if [ ${#} -eq 0 ] || [ ${#} -ge 4 ]; then die "Wrong number of arguments specified. See './build help'." fi +mode="${1}" +option="${2}" +shift 2 -[ "${1}" = help ] && help && exit 0 +[ "${mode}" = help ] && help && exit 0 -case "${2}" in +case "${option}" in list) - printf "Available options for mode '%s':\n\n" "${1}" - listoptions "${1}" + printf "Available options for mode '%s':\n\n" "${mode}" + listoptions "${mode}" ;; all) - for option in $(listoptions "${1}"); do - "${build}"/"${1}"/"${2}" "$@" + for option in $(listoptions "${mode}"); do + "${build}"/"${mode}"/"${option}" "$@" done ;; *) - if [ -d "${build}"/"${1}"/ ]; then - if [ -f "${build}"/"${1}"/"${2}" ]; then - "${build}"/"${1}"/"${2}" "$@" + if [ -d "${build}"/"${mode}"/ ]; then + if [ -f "${build}"/"${mode}"/"${option}" ]; then + "${build}"/"${mode}"/"${option}" "$@" else - die "Invalid option for '${1}'. See './build ${1} list'." + die "Invalid option for '${mode}'. See './build ${mode} list'." fi else die "Invalid mode. See './build help'." -- cgit v0.9.1