From 1eb130320e77765a84c0abadcf0bebfadc30fed6 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Mon, 2 Dec 2024 15:07:55 +0100 Subject: [PATCH] context/command,shell --- sh/main.sh | 21 ++++++--------------- 1 file changed, 6 insertions(+), 15 deletions(-) diff --git a/sh/main.sh b/sh/main.sh index 6b1605d..eb938e8 100755 --- a/sh/main.sh +++ b/sh/main.sh @@ -131,13 +131,11 @@ rwx_main() { fi # user root rwx_source "${RWX_SELF_USER}" - # - local argument - argument="$(echo "${0}" | sed "s|^-||")" - case "${argument}" in - "bash" | \ - "dash" | \ - "sh") + # context / command + if [ -n "${RWX_COMMAND_NAME}" ]; then + "${RWX_SELF_COMMAND}${RWX_COMMAND_NAME}" "${@}" + # context / shell + else # run interactive extras if rwx_shell_interactive; then # check format @@ -150,14 +148,7 @@ rwx_main() { rwx_log rwx_self_help fi - ;; - *) - local function name - name="$(basename "${argument}")" - function="${RWX_SELF_COMMAND}${name}" - "${function}" "${@}" - ;; - esac + fi } # run main function