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)) {