aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarkus Teich <markus.teich@stusta.mhn.de>2016-01-17 13:36:40 (GMT)
committerGerrit Code Review <gerrit@cyanogenmod.org>2016-01-17 20:53:19 (GMT)
commit58d16c1db9650e0da6f7c6ec5cc6fe8cc944f1ab (patch)
tree7a23241bb19d67e3f4394d913c5864b6398a1170
parent5550f56115e785b34dadfdf05f8f2e90ffcf9713 (diff)
downloadandroid_external_gello_build-58d16c1db9650e0da6f7c6ec5cc6fe8cc944f1ab.zip
android_external_gello_build-58d16c1db9650e0da6f7c6ec5cc6fe8cc944f1ab.tar.gz
android_external_gello_build-58d16c1db9650e0da6f7c6ec5cc6fe8cc944f1ab.tar.bz2
gello-build: streamline flag parsing
Change-Id: I9633d1dde3cf881e12327ae020f7f7bf29377cfb
-rwxr-xr-xgello_build.sh56
1 files changed, 23 insertions, 33 deletions
diff --git a/gello_build.sh b/gello_build.sh
index ebe13fd..82922b6 100755
--- a/gello_build.sh
+++ b/gello_build.sh
@@ -145,38 +145,28 @@ function compile() {
##
# Check Flags
#
-function checkflags() {
- if [ "$1" == "--verbose" ] || [ "$2" == "--verbose" ] ||
- [ "$3" == "--verbose" ] || [ "$4" == "--verbose" ] ||
- [ "$5" == "--verbose" ]; then
- VERBOSE=true
- fi
-
- if [ "$1" == "--fast" ] || [ "$2" == "--fast" ] ||
- [ "$3" == "--fast" ] || [ "$4" == "--fast" ] ||
- [ "$5" == "--fast" ]; then
- NOSYNC=true
- FAST=true
- fi
-
- if [ "$1" == "--no-sync" ] || [ "$2" == "--no-sync" ] ||
- [ "$3" == "--no-sync" ] || [ "$4" == "--no-sync" ] ||
- [ "$5" == "--no-sync" ]; then
- NOSYNC=true
- fi
-
- if [ "$1" == "--push" ] || [ "$2" == "--push" ] ||
- [ "$3" == "--push" ] || [ "$4" == "--push" ] ||
- [ "$5" == "--push" ]; then
- PUSH=true
- fi
-
- if [ "$1" == "--clean" ] || [ "$2" == "--clean" ] ||
- [ "$3" == "--clean" ] || [ "$4" == "--clean" ] ||
- [ "$5" == "--clean" ]; then
- CLEAN=true
- fi
-
+function parseflags() {
+ for flag in "$@"
+ do
+ case "$flag" in
+ --verbose)
+ VERBOSE=true
+ ;;
+ --fast)
+ NOSYNC=true
+ FAST=true
+ ;;
+ --no-sync)
+ NOSYNC=true
+ ;;
+ --push)
+ PUSH=true
+ ;;
+ --clean)
+ CLEAN=true
+ ;;
+ esac
+ done
}
@@ -219,7 +209,7 @@ elif [ "$1" == "--help" ]; then
helpgello && exit 0
fi
-checkflags $1 $2 $3 $4 $5
+parseflags "$@"
sync && setup && compile