2017-03-30 10:23:10 +02:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
#
|
2017-12-08 05:39:13 +01:00
|
|
|
# This script will exec Brotli tool with -e/-d options.
|
2017-03-30 10:23:10 +02:00
|
|
|
#
|
|
|
|
# Copyright (c) 2017, Intel Corporation. All rights reserved.<BR>
|
|
|
|
# This program and the accompanying materials
|
|
|
|
# are licensed and made available under the terms and conditions of the BSD License
|
|
|
|
# which accompanies this distribution. The full text of the license may be found at
|
|
|
|
# http://opensource.org/licenses/bsd-license.php
|
|
|
|
#
|
|
|
|
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
|
|
|
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
|
|
|
#
|
2017-04-13 03:19:48 +02:00
|
|
|
QLT="-q 9"
|
|
|
|
INPUTFLAG=0
|
2017-12-08 05:39:13 +01:00
|
|
|
ARGS=
|
2017-03-30 10:23:10 +02:00
|
|
|
|
2017-12-08 05:39:13 +01:00
|
|
|
while test $# -gt 0
|
|
|
|
do
|
|
|
|
case $1 in
|
|
|
|
-e)
|
2017-04-13 03:19:48 +02:00
|
|
|
INPUTFLAG=1
|
2017-12-08 05:39:13 +01:00
|
|
|
;;
|
|
|
|
-d)
|
2017-04-13 03:19:48 +02:00
|
|
|
INPUTFLAG=1
|
2017-12-08 05:39:13 +01:00
|
|
|
ARGS+="$1 "
|
|
|
|
;;
|
|
|
|
-o|-g)
|
2017-04-13 03:19:48 +02:00
|
|
|
ARGS+="$1 $2 "
|
2017-03-30 10:23:10 +02:00
|
|
|
shift
|
2017-12-08 05:39:13 +01:00
|
|
|
;;
|
|
|
|
-q)
|
2017-04-13 03:19:48 +02:00
|
|
|
QLT="$1 $2 "
|
2017-03-30 10:23:10 +02:00
|
|
|
shift
|
2017-12-08 05:39:13 +01:00
|
|
|
;;
|
|
|
|
*)
|
|
|
|
if [ $INPUTFLAG -eq 1 ]
|
2017-04-13 08:40:30 +02:00
|
|
|
then
|
2017-12-08 05:39:13 +01:00
|
|
|
ARGS+="-i $1 "
|
|
|
|
INPUTFLAG=0
|
|
|
|
else
|
|
|
|
ARGS+="$1 "
|
2017-04-13 03:19:48 +02:00
|
|
|
fi
|
2017-12-08 05:39:13 +01:00
|
|
|
;;
|
|
|
|
esac
|
|
|
|
shift
|
2017-03-30 10:23:10 +02:00
|
|
|
done
|
|
|
|
|
2017-12-08 05:39:13 +01:00
|
|
|
exec Brotli $ARGS $QLT
|