Author: wyoung
Date: Sun Apr  1 23:40:45 2007
New Revision: 1489

URL: http://svn.gna.org/viewcvs/mysqlpp?rev=1489&view=rev
Log:
Refactored exrun a bit to reduce redundant code.

Modified:
    trunk/exrun

Modified: trunk/exrun
URL: 
http://svn.gna.org/viewcvs/mysqlpp/trunk/exrun?rev=1489&r1=1488&r2=1489&view=diff
==============================================================================
--- trunk/exrun (original)
+++ trunk/exrun Sun Apr  1 23:40:45 2007
@@ -17,45 +17,38 @@
 PROG=$1
 if [ "$PROG" == 'valgrind' ]
 then
-       TOOL=valgrind
+       TOOL='valgrind'
        shift
-       if [ -z "$1" ]
-       then
-               echo "usage: $0 valgrind <example> [args...]"
-               echo
-               echo "   Run $0 without arguments for more detailed usage info."
-               echo
-               exit 1
-       fi
        PROG=$1
-
 elif [ "$PROG" == 'gdb' ]
 then
        TOOL='gdb --args'
        shift
-       if [ -z "$1" ]
-       then
-               echo "usage: $0 gdb <example> [args...]"
-               echo
-               echo "   Run $0 without arguments for more detailed usage info."
-               echo
-               exit 1
-       fi
        PROG=$1
 fi
-shift
 
-if [ ! -e libmysqlpp.so.2 ]
+if [ -n "$1" ]
 then
-       ( ln -sf libmysqlpp.so libmysqlpp.so.2 )
+       shift
+
+       if [ ! -e libmysqlpp.so.2 ]
+       then
+               ( ln -sf libmysqlpp.so libmysqlpp.so.2 )
+       fi
+
+       if [ -e /usr/bin/ldd ]
+       then
+               LD_LIBRARY_PATH=. $TOOL ./$PROG $*
+       elif [ -e /usr/bin/otool ]
+       then
+               DYLD_LIBRARY_PATH=. $TOOL ./$PROG $*
+       else
+               echo ERROR: I don\'t grok this system\'s dynamic linkage system.
+       fi
+else
+       echo "usage: $0 $TOOL <example> [args...]"
+       echo
+       echo "   Run $0 without arguments for more detailed usage info."
+       echo
+       exit 1
 fi
-
-if [ -e /usr/bin/ldd ]
-then
-       LD_LIBRARY_PATH=. $TOOL ./$PROG $*
-elif [ -e /usr/bin/otool ]
-then
-       DYLD_LIBRARY_PATH=. $TOOL ./$PROG $*
-else
-       echo ERROR: I don\'t grok this system\'s dynamic linkage system.
-fi


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

Reply via email to