From 585f321fdcf8c59f94e4f7587ed395073c107d4a Mon Sep 17 00:00:00 2001 From: Alexander Rosenberg Date: Mon, 5 Aug 2024 20:50:53 -0700 Subject: [PATCH] Fix help menu for xwayland-game-wrapper --- xwayland-game-wrapper | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/xwayland-game-wrapper b/xwayland-game-wrapper index 9f26a64..0fedddc 100755 --- a/xwayland-game-wrapper +++ b/xwayland-game-wrapper @@ -15,7 +15,8 @@ function die { # print_help function print_help { - printf 'usage: %s [OPTIONS...] [ARGS...]\n' "${1}" + local exec_name="$(basename "${1}")" + printf 'usage: %s [OPTIONS...] [ARGS...]\n' "${exec_name}" printf 'Run a game inside an Xwayland session with a window manager. This\n' printf 'is very similar to gamescope, except that there is a window\n' printf 'involved. The default window manager is OpenBox.\n' @@ -64,7 +65,7 @@ function get_default_resolution { while getopts ':hw:r:d:' OPTOPT; do case "${OPTOPT}" in 'h') - print_help "${1}" + print_help "${0}" ;; 'w') window_manager="${OPTARG}" @@ -84,7 +85,7 @@ while getopts ':hw:r:d:' OPTOPT; do esac done -(( "${OPTIND}" > ${#} )) && print_help +(( "${OPTIND}" > ${#} )) && print_help "${0}" shift $(( "${OPTIND}" - 1)) {