dist/freedoom: use DOOMPORT envvar rather than PORT (breaking change)

PORT is too generic, especially if refering to TCP/UDP ports, and if
those are set, the freedoom script may not work properly.  DOOMPORT is
a reasonable alternative.
master
Mike Swanson 2019-09-04 14:08:34 -07:00
parent 96b28272a6
commit fe7d6f864a
2 changed files with 15 additions and 13 deletions

10
dist/freedoom vendored
View File

@ -12,7 +12,7 @@ PORTS="doom odamex crispy-doom prboom-plus eternity gzdoom chocolate-doom"
if [ $# -gt 0 ]; then
if [ "$1" = "-p" ]; then
PORT="$2"
DOOMPORT="$2"
shift; shift
elif [ "$1" = "--" ]; then
shift
@ -31,15 +31,15 @@ case "$(basename "$0")" in
;;
esac
if [ -z "$PORT" ] && [ -h "$HOME"/.doomport ]; then
if [ -z "$DOOMPORT" ] && [ -h "$HOME"/.doomport ]; then
if [ -f "$(readlink -f "$HOME"/.doomport)" ] \
&& [ -x "$(readlink -f "$HOME"/.doomport)" ]; then
PORT="$(readlink -f "$HOME"/.doomport)"
DOOMPORT="$(readlink -f "$HOME"/.doomport)"
fi
fi
if [ "$PORT" ]; then
exec "$PORT" -iwad "$IWAD" "$@"
if [ "$DOOMPORT" ]; then
exec "$DOOMPORT" -iwad "$IWAD" "$@"
fi
dirpath=$(eval echo "\${PATH}" 2>/dev/null | tr : ' ')

18
dist/freedoom.adoc vendored
View File

@ -8,7 +8,7 @@ freedoom - Automatically launch Freedoom with an engine
SYNOPSIS
--------
*freedoom* [_-p_ _PORT_|_--_] [_ARGS_]
*freedoom* [_-p_ _DOOMPORT_|_--_] [_ARGS_]
DESCRIPTION
-----------
@ -21,13 +21,15 @@ active community since 1993.
This command is a simple shell script to assist in running Freedoom,
which is not a game engine itself nor part of any engine project, but
playing Freedoom should remain simple. Only accepted as the first
argument, you may pass _-p PORT_, which will run Freedoom using the
_PORT_ specified. As an alternative, you may make a symbolic link
named +$HOME/.doomport+ to your preferred port. A port specified on
the command line explicitly overrides +$HOME/.doomport+, whereas the
existence of the symbolic link will override the detection of port
based on a hard-coded list.
playing Freedoom should remain simple. The script tries to
automatically select an engine based on a hard-coded list, but three
overrides are available, in order of precedence: command-line
argument, environment variable, and a +$HOME/.doomport+ symbolic link.
Passing _-p DOOMPORT_ runs Freedoom using the _DOOMPORT_ specified.
Setting the _DOOMPORT_ environment variable is similar, running the
engine specified in the variable. An additional permanent setting is
via the +$HOME/.doomport+ symbolic link, which may point to an
executable to run.
Additional arguments passed to the program, or after specifying _--_
as the first option, will be passed to the engine being called. This