add -x (--exec) flag to run DFHack via the exec builtin

this means the process run by ./dfhack will be Dwarf Fortress itself rather than the wrapper script, but it also means that no cleanup actions can occur.
develop
Ben Lubar 2020-02-09 18:01:24 -06:00
parent 05a49cbacb
commit be881936f3
No known key found for this signature in database
GPG Key ID: 92939677AB59EDA4
1 changed files with 4 additions and 0 deletions

@ -136,6 +136,10 @@ case "$1" in
strace -f setarch "$setarch_arch" -R env LD_PRELOAD="$PRELOAD_LIB" ./libs/Dwarf_Fortress "$@" 2> strace.log
ret=$?
;;
-x || --exec)
exec setarch "$setarch_arch" -R env LD_PRELOAD="$PRELOAD_LIB" ./libs/Dwarf_Fortress "$@"
# script does not resume
;;
*)
setarch "$setarch_arch" -R env LD_PRELOAD="$PRELOAD_LIB" ./libs/Dwarf_Fortress "$@"
ret=$?