libreboot

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README

commit 8f41da759a0f5352093ced98a2f03e62c970f8de
parent 25a828190b2a08105ad561b5b417bb61a383fc4f
Author: Francis Rowe <info@gluglug.org.uk>
Date:   Thu, 10 Mar 2016 21:59:28 +0000

build: allow unlimited number of additional parameters

This restores previous functionality, which is needed for the build/roms/
scripts.

Diffstat:
build | 55+++++++++++++++++++++++++++++++------------------------
1 file changed, 31 insertions(+), 24 deletions(-)

diff --git a/build b/build @@ -59,34 +59,41 @@ die() { exit 1 } -if [ ${#} -eq 0 ] || [ ${#} -ge 4 ]; then +if [ $# -lt 1 ]; then die "Wrong number of arguments specified. See './build help'." fi mode="${1}" -option="${2}" -shift 2 [ "${mode}" = help ] && help && exit 0 -case "${option}" in - list) - printf "Available options for mode '%s':\n\n" "${mode}" - listoptions "${mode}" - ;; - all) - for option in $(listoptions "${mode}"); do - "${build}"/"${mode}"/"${option}" "$@" - done - ;; - *) - if [ -d "${build}"/"${mode}"/ ]; then - if [ -f "${build}"/"${mode}"/"${option}" ]; then - "${build}"/"${mode}"/"${option}" "$@" - else - die "Invalid option for '${mode}'. See './build ${mode} list'." - fi - else - die "Invalid mode. See './build help'." - fi -esac +if [ $# -gt 1 ]; then + + option="${2}" + shift 2 + + case "${option}" in + list) + printf "Available options for mode '%s':\n\n" "${mode}" + listoptions "${mode}" + ;; + all) + for option in $(listoptions "${mode}"); do + "${build}"/"${mode}"/"${option}" "$@" + done + ;; + *) + if [ -d "${build}"/"${mode}"/ ]; then + if [ -f "${build}"/"${mode}"/"${option}" ]; then + "${build}"/"${mode}"/"${option}" "$@" + else + die "Invalid option for '${mode}'. See './build ${mode} list'." + fi + else + die "Invalid mode. See './build help'." + fi + esac +else + help + exit 0 +fi