summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrancis Rowe <info@gluglug.org.uk>2016-03-10 16:59:28 (EST)
committer Francis Rowe <info@gluglug.org.uk>2016-03-10 16:59:28 (EST)
commit8f41da759a0f5352093ced98a2f03e62c970f8de (patch)
treeffe5565b26f5d39f4a136aaed519e380ba95ec03
parent25a828190b2a08105ad561b5b417bb61a383fc4f (diff)
downloadlibreboot-8f41da759a0f5352093ced98a2f03e62c970f8de.zip
libreboot-8f41da759a0f5352093ced98a2f03e62c970f8de.tar.gz
libreboot-8f41da759a0f5352093ced98a2f03e62c970f8de.tar.bz2
build: allow unlimited number of additional parameters
This restores previous functionality, which is needed for the build/roms/ scripts.
-rwxr-xr-xbuild55
1 files changed, 31 insertions, 24 deletions
diff --git a/build b/build
index 069d652..a4fa0a7 100755
--- 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