diff options
author | Liming Gao <liming.gao@intel.com> | 2017-12-08 12:39:13 +0800 |
---|---|---|
committer | Liming Gao <liming.gao@intel.com> | 2017-12-12 18:01:10 +0800 |
commit | 83e901a507804bf27b8e6c8c2ec7c8f16555b495 (patch) | |
tree | fb0c869674602e8a2be71f7f96d7bfbaa6d95de2 /BaseTools/BinWrappers | |
parent | 267345ff4f309ad6d4a12b358e1746ba079092d9 (diff) | |
download | edk2-83e901a507804bf27b8e6c8c2ec7c8f16555b495.tar.gz edk2-83e901a507804bf27b8e6c8c2ec7c8f16555b495.tar.bz2 edk2-83e901a507804bf27b8e6c8c2ec7c8f16555b495.zip |
BaseTools: Update BrotliCompress script to handle the different input format
After this update, BrotliCompress can support below styles.
BrotliCompress -e InputFile -o OutputFile
BrotliCompress -e -o OutputFile InputFile
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
Diffstat (limited to 'BaseTools/BinWrappers')
-rwxr-xr-x | BaseTools/BinWrappers/PosixLike/BrotliCompress | 61 |
1 files changed, 24 insertions, 37 deletions
diff --git a/BaseTools/BinWrappers/PosixLike/BrotliCompress b/BaseTools/BinWrappers/PosixLike/BrotliCompress index ca32d6a55c..6e4c8c992e 100755 --- a/BaseTools/BinWrappers/PosixLike/BrotliCompress +++ b/BaseTools/BinWrappers/PosixLike/BrotliCompress @@ -1,6 +1,6 @@ #!/usr/bin/env bash # -# This script will exec Brotli tool. +# This script will exec Brotli tool with -e/-d options. # # Copyright (c) 2017, Intel Corporation. All rights reserved.<BR> # This program and the accompanying materials @@ -13,50 +13,37 @@ # QLT="-q 9" INPUTFLAG=0 +ARGS= -for arg; do - if [ $1 = -d ] - then +while test $# -gt 0 +do + case $1 in + -e) INPUTFLAG=1 - fi - if [ $1 = -e ] - then + ;; + -d) INPUTFLAG=1 - shift - continue; - fi - if [ $1 = -g ] - then - ARGS+="$1 $2 " - shift - shift - continue; - fi - if [ $1 = -o ] - then + ARGS+="$1 " + ;; + -o|-g) ARGS+="$1 $2 " shift - shift - continue; - fi - if [ $1 = -q ] - then + ;; + -q) QLT="$1 $2 " shift - shift - continue; - fi - if [ $INPUTFLAG -eq 1 ] - then - if [ -z $2 ] + ;; + *) + if [ $INPUTFLAG -eq 1 ] then - ARGS+="$QLT -i $1 " - break; + ARGS+="-i $1 " + INPUTFLAG=0 + else + ARGS+="$1 " fi - fi - -ARGS+="$1 " -shift + ;; + esac + shift done -exec Brotli $ARGS +exec Brotli $ARGS $QLT |