aboutsummaryrefslogtreecommitdiff
path: root/build
diff options
context:
space:
mode:
authorFrancis Rowe <info@gluglug.org.uk>2016-03-10 21:59:28 +0000
committerFrancis Rowe <info@gluglug.org.uk>2016-03-10 21:59:28 +0000
commit8f41da759a0f5352093ced98a2f03e62c970f8de (patch)
treeffe5565b26f5d39f4a136aaed519e380ba95ec03 /build
parent25a828190b2a08105ad561b5b417bb61a383fc4f (diff)
downloadlibrebootfr-8f41da759a0f5352093ced98a2f03e62c970f8de.tar.gz
librebootfr-8f41da759a0f5352093ced98a2f03e62c970f8de.zip
build: allow unlimited number of additional parameters
This restores previous functionality, which is needed for the build/roms/ scripts.
Diffstat (limited to 'build')
-rwxr-xr-xbuild55
1 files changed, 31 insertions, 24 deletions
diff --git a/build b/build
index 069d6526..a4fa0a70 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