Author: caslav_ilic
Date: Sat Jan 16 21:12:27 2010
New Revision: 40716

URL: http://svn.gna.org/viewcvs/wesnoth?rev=40716&view=rev
Log:
Optional processing of files given on command line, instead of all files in CWD.

Modified:
    trunk/changelog
    trunk/utils/wesnoth-optipng

Modified: trunk/changelog
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/changelog?rev=40716&r1=40715&r2=40716&view=diff
==============================================================================
--- trunk/changelog (original)
+++ trunk/changelog Sat Jan 16 21:12:27 2010
@@ -32,6 +32,7 @@
    * 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:

Modified: trunk/utils/wesnoth-optipng
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/utils/wesnoth-optipng?rev=40716&r1=40715&r2=40716&view=diff
==============================================================================
--- trunk/utils/wesnoth-optipng (original)
+++ trunk/utils/wesnoth-optipng Sat Jan 16 21:12:27 2010
@@ -141,17 +141,20 @@
 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 @@
 and available in PATH.
 EOSTREAM
                exit 0
-       fi
-       shift
+       else
+               filelist="${filelist} ${1}"
+               shift
+       fi
 done
 
 # FIXME: disabled because it isn't working for Ivanovic.
@@ -187,7 +192,9 @@
 # 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 "*************************"


_______________________________________________
Wesnoth-commits mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-commits

Reply via email to