Fix help menu for xwayland-game-wrapper

This commit is contained in:
Alexander Rosenberg 2024-08-05 20:50:53 -07:00
parent 2c33cdc65f
commit 585f321fdc
Signed by: Zander671
GPG Key ID: 5FD0394ADBD72730

View File

@ -15,7 +15,8 @@ function die {
# print_help <argv[0]>
function print_help {
printf 'usage: %s [OPTIONS...] <GAME> [ARGS...]\n' "${1}"
local exec_name="$(basename "${1}")"
printf 'usage: %s [OPTIONS...] <GAME> [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))
{