context/command,shell

This commit is contained in:
Marc Beninca 2024-12-02 15:07:55 +01:00
parent 68ec08871c
commit 1eb130320e
Signed by: marc.beninca
GPG key ID: 9C7613450C80C24F

View file

@ -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