From fe7d6f864ad0d32f859587261760ca5747d22f91 Mon Sep 17 00:00:00 2001 From: Mike Swanson Date: Wed, 4 Sep 2019 14:08:34 -0700 Subject: [PATCH] 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. --- dist/freedoom | 10 +++++----- dist/freedoom.adoc | 18 ++++++++++-------- 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/dist/freedoom b/dist/freedoom index aa84c169..08863923 100755 --- a/dist/freedoom +++ b/dist/freedoom @@ -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 : ' ') diff --git a/dist/freedoom.adoc b/dist/freedoom.adoc index 580fc9b8..8d378244 100644 --- a/dist/freedoom.adoc +++ b/dist/freedoom.adoc @@ -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