BaseTools: Sync BrotliCompress script the same style
authorSong, BinX <binx.song@intel.com>
Thu, 13 Apr 2017 06:40:30 +0000 (14:40 +0800)
committerLiming Gao <liming.gao@intel.com>
Fri, 5 May 2017 03:15:25 +0000 (11:15 +0800)
- Sync BrotliCompress script the same style with BrotliCompress.bat

Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Bell Song <binx.song@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
BaseTools/BinWrappers/PosixLike/BrotliCompress

index 49358b2..ca32d6a 100755 (executable)
 QLT="-q 9"
 INPUTFLAG=0
 
-while [ $# != 0 ];do
-  case $1 in
-    -d)
+for arg; do
+  if [ $1 = -d ]
+    then
       INPUTFLAG=1
-      ARGS+="$1 "
-    ;;
-    -e)
+  fi
+  if [ $1 = -e ]
+    then
       INPUTFLAG=1
-    ;;
-    -g)
+      shift
+      continue;
+  fi
+  if [ $1 = -g ]
+    then
       ARGS+="$1 $2 "
       shift
-    ;;
-    -o)
+      shift
+      continue;
+  fi
+  if [ $1 = -o ]
+    then
       ARGS+="$1 $2 "
       shift
-    ;;
-    -q)
+      shift
+      continue;
+  fi
+  if [ $1 = -q ]
+    then
       QLT="$1 $2 "
       shift
-    ;;
-    *)
-      if [ $INPUTFLAG -eq 1 ]
-      then
-        if [ -z $2 ]
-          then
-            ARGS+="$QLT -i $1 "
-            break;
-        fi
+      shift
+      continue;
+  fi
+  if [ $INPUTFLAG -eq 1 ]
+    then
+      if [ -z $2 ]
+        then
+          ARGS+="$QLT -i $1 "
+          break;
       fi
-      ARGS+="$1 "
-  esac
+  fi
 
+ARGS+="$1 "
 shift
 done