+TEMP=`getopt -o sr --long serial,rerun -n 'execute.sh' -- "$@"`
+
+if [ $? != 0 ] ; then echo "Terminating..." >&2 ; exit 1 ; fi
+
+# Note the quotes around `$TEMP': they are essential!
+eval set -- "$TEMP"
+
+opt_parallel=1
+opt_rerun=""
+while true ; do
+ case "$1" in
+ -s|--serial) opt_parallel=0 ; shift ;;
+ -r|--rerun) opt_rerun="-r" ; shift ;;
+ --) shift; break;;
+ *) echo "Internal error $1!" ; exit 1 ;;
+ esac
+done
+