Commit c4086a76 authored by eustas@chromium.org's avatar eustas@chromium.org

Make output concise by default.

BUG=

Review URL: https://codereview.chromium.org/60733028

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@244137 0039d316-1c4b-4281-b951-d872f2087c98
parent 35063fc4
...@@ -54,11 +54,11 @@ PROCESSED_FILE=0 ...@@ -54,11 +54,11 @@ PROCESSED_FILE=0
declare -a THROBBER_STR=('-' '\\' '|' '/') declare -a THROBBER_STR=('-' '\\' '|' '/')
THROBBER_COUNT=0 THROBBER_COUNT=0
SUBPROCESS=0 VERBOSE=0
# NoOp in subprocess, echo otherwise. # Echo only if verbose option is set.
function info { function info {
if [ $SUBPROCESS -eq 0 ]; then if [ $VERBOSE -eq 1 ]; then
echo $@ echo $@
fi fi
} }
...@@ -384,8 +384,7 @@ Options: ...@@ -384,8 +384,7 @@ Options:
-r<revision> If this is specified, the script processes only png files -r<revision> If this is specified, the script processes only png files
changed since this revision. The <dir> options will be used changed since this revision. The <dir> options will be used
to narrow down the files under specific directories. to narrow down the files under specific directories.
-s Run as subprocess. This may be used to parallelize execution. -v Shows optimization process for each file.
Usage: find <dir> -name \"*.png\" | xargs -n1 -P16 $program -s -o2
-h Print this help text." -h Print this help text."
exit 1 exit 1
} }
...@@ -403,7 +402,7 @@ fi ...@@ -403,7 +402,7 @@ fi
OPTIMIZE_LEVEL=1 OPTIMIZE_LEVEL=1
# Parse options # Parse options
while getopts o:r:h:s opts while getopts o:r:h:v opts
do do
case $opts in case $opts in
r) r)
...@@ -419,8 +418,8 @@ do ...@@ -419,8 +418,8 @@ do
fi fi
OPTIMIZE_LEVEL=$OPTARG OPTIMIZE_LEVEL=$OPTARG
;; ;;
s) v)
let SUBPROCESS=1 let VERBOSE=1
;; ;;
[h?]) [h?])
show_help;; show_help;;
...@@ -479,7 +478,7 @@ else ...@@ -479,7 +478,7 @@ else
for d in $DIRS; do for d in $DIRS; do
info "Optimizing png files in $d" info "Optimizing png files in $d"
optimize_dir $d optimize_dir $d
echo info ""
done done
fi fi
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment