SOURCES: odtransform.sh -cosmetics, work with spaces in args

glen glen at pld-linux.org
Tue Jan 27 13:23:15 CET 2009


Author: glen                         Date: Tue Jan 27 12:23:15 2009 GMT
Module: SOURCES                       Tag: HEAD
---- Log message:
 -cosmetics, work with spaces in args

---- Files affected:
SOURCES:
   odtransform.sh (1.2 -> 1.3) 

---- Diffs:

================================================================
Index: SOURCES/odtransform.sh
diff -u SOURCES/odtransform.sh:1.2 SOURCES/odtransform.sh:1.3
--- SOURCES/odtransform.sh:1.2	Tue Jan 27 10:28:28 2009
+++ SOURCES/odtransform.sh	Tue Jan 27 13:23:09 2009
@@ -6,8 +6,7 @@
 # from subversion repository:
 # http://svn.clazzes.org/svn/odtransform/trunk/odtransform/src/main/assembly/odtransform.sh
 
-if test "$JAVA_HOME" = ""
-then
+if test "$JAVA_HOME" = ""; then
   JAVA_CMD=java
 else
   JAVA_CMD=$JAVA_HOME/bin/java
@@ -18,31 +17,34 @@
 DEBUG=0
 
 usage() {
-cat << EOF
+	cat << EOF
 odtversion rev 19
 Usage: $0 [stylesheet] [OpenDocument]
 EOF
 }
 
-while test $# -ge 1
-do
+while [ $# -ge 1 ]; do
     case "$1" in
-    --debug)         LOG4JPROPS=/usr/share/odtransform/log4j_debug.properties
-        shift 1
+    --debug)
+		LOG4JPROPS=/usr/share/odtransform/log4j_debug.properties
+        shift
         ;;
-    --debug-startup) DEBUG=1
-        shift 1
-        ;;    
-    --quiet)         LOG4JPROPS=/usr/share/odtransform/log4j_quiet.properties
-        shift 1
+    --debug-startup)
+		DEBUG=1
+        shift
         ;;
-    --verbose)       LOG4JPROPS=/usr/share/odtransform/log4j_verbose.properties
-        shift 1
+    --quiet)
+		LOG4JPROPS=/usr/share/odtransform/log4j_quiet.properties
+        shift
+        ;;
+    --verbose)
+		LOG4JPROPS=/usr/share/odtransform/log4j_verbose.properties
+        shift
         ;;
     --help)
     	usage()
-	exit
-	;;
+		exit
+		;;
     *)
         break
         ;;
@@ -51,11 +53,10 @@
 
 CLASSPATH=$(build-classpath commons-logging log4j jaxp_parser_impl xalan odtransform)
 
-if test $DEBUG -ne 0
-then
+if [ $DEBUG != 0 ]; then
     echo '*****************************************************'
-    echo $JAVA_CMD -Dlog4j.configuration=file:$LOG4JPROPS -cp $CLASSPATH org.clazzes.odtransform.OdtTransform $*
+    echo $JAVA_CMD -Dlog4j.configuration=file:$LOG4JPROPS -cp $CLASSPATH org.clazzes.odtransform.OdtTransform ${1:+"$@"}
     echo '*****************************************************'
 fi
 
-$JAVA_CMD -Dlog4j.configuration=file:$LOG4JPROPS -cp $CLASSPATH org.clazzes.odtransform.OdtTransform $*
+$JAVA_CMD -Dlog4j.configuration=file:$LOG4JPROPS -cp $CLASSPATH org.clazzes.odtransform.OdtTransform ${1:+"$@"}
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/SOURCES/odtransform.sh?r1=1.2&r2=1.3&f=u



More information about the pld-cvs-commit mailing list