]> git.rm.cloudns.org Git - xonotic/xonotic.git/commitdiff
./all run dedicated: use rlwrap if available
authorRudolf Polzer <divverent@alientrap.org>
Thu, 14 Jun 2012 08:25:03 +0000 (10:25 +0200)
committerRudolf Polzer <divverent@alientrap.org>
Thu, 14 Jun 2012 08:25:03 +0000 (10:25 +0200)
misc/tools/all/xonotic.subr

index e18d7fe2f9d0c84efac34c9a7b95c6cd30ddc73b..fc6a498dca55af3e8053b0144bbd24c653bc5d16 100644 (file)
@@ -244,11 +244,17 @@ case "$cmd" in
                        client=-sdl
                fi
                case "$1" in
-                       sdl|glx|agl|dedicated)
+                       dedicated)
+                               client=-$1
+                               shift
+                               ;;
+                       sdl|glx|agl)
+                               USE_RLWRAP=no
                                client=-$1
                                shift
                                ;;
                        wgl)
+                               USE_RLWRAP=no
                                client=
                                shift
                                ;;
@@ -276,11 +282,16 @@ case "$cmd" in
 
                if [ x"$USE_GDB" = x"yes" ]; then
                        set -- gdb --args "$@"
-               elif [ x"$USE_GDB" = x"core" ] && which gdb >/dev/null 2>&1; then
+                       USE_RLWRAP=no
+               elif [ x"$USE_GDB" = x"core" ]; then
                        set -- gdb --batch -x savecore.gdb --args "$@"
+                       USE_RLWRAP=no
                elif which catchsegv >/dev/null 2>&1; then
                        set -- catchsegv "$@"
                fi
+               if [ x"$USE_RLWRAP" != x"no" ] && which rlwrap >/dev/null 2>&1; then
+                       set -- rlwrap -A -g '^quit' -q "\"" -r -S ']' -w 100 "$@"
+               fi
                rm -f xonotic.core
                "$@" || true
                if [ -f xonotic.core ]; then