Optional processing of files given on command line,

...instead of all files in CWD.
This commit is contained in:
Chusslove Illich 2010-01-16 20:12:27 +00:00
parent 1281a02262
commit 14d29ec9bd
2 changed files with 13 additions and 5 deletions

View file

@ -32,6 +32,7 @@ Version 1.7.11+svn:
* Fixed serveral issues found by cppcheck
* Fixed drawing glitches with tiled gui2 windows in the lobby
* Fix some doxygen warnings
* wesnoth-optipng can now process selected files given on command line
Version 1.7.11-1.8beta4:
* Language and i18n:

View file

@ -141,17 +141,20 @@ print_statistics()
while [ "${1}" != "" ]; do
if [ "${1}" = "--nice" ] || [ "${1}" = "-n" ]; then
opti_nice=$2
shift
shift 2
elif [ "${1}" = "--threads" ]; then
max_number_threads=$2
shift
shift 2
elif [ "${1}" = "--help" ] || [ "${1}" = "-h" ]; then
cat << EOSTREAM
Wesnoth automatic PNG optimization helper script
Part of the Battle for Wesnoth project <www.wesnoth.org>
Usage:
$(basename ${0}) [{--nice|n} <value>] [{--threads} <value>] [{--help|-h}]
$(basename ${0}) [{--nice|n} <value>] [{--threads} <value>] [{--help|-h}] [<file>...]
If no files are given on command line, all PNG files within current working
directory and below are processed.
Switches:
--help / -h Displays this help text.
@ -169,8 +172,10 @@ convert utility (http://www.imagemagick.org/script/convert.php) to be installed
and available in PATH.
EOSTREAM
exit 0
else
filelist="${filelist} ${1}"
shift
fi
shift
done
# FIXME: disabled because it isn't working for Ivanovic.
@ -187,7 +192,9 @@ which advdef &> /dev/null ||
# Set-up a trap to avoid leaving orphan tempfiles behind.
trap user_int HUP INT TERM
filelist=$(find -iname "*.png")
if test -z "$filelist"; then
filelist=$(find -iname "*.png")
fi
# work with a parallized joblist
echo "*************************"