context/command

This commit is contained in:
Marc Beninca 2025-07-10 04:02:44 +02:00
parent bcf879ddc3
commit 79a8584fde
Signed by: marc.beninca
GPG key ID: 9C7613450C80C24F

View file

@ -296,22 +296,21 @@ ${rwx_code_modules_user}
EOF EOF
# load code cache # load code cache
rwx_code_load rwx_code_load
# set command
local command
# command name used to run
# (stripped from hyphen interactive flag)
command="$(basename "${0}" | sed "s|^-||")"
case "${command}" in
"bash" | "dash" | "sh") unset command ;;
*) ;;
esac
# context / shell # context / shell
if rwx_shell_interactive; then if rwx_shell_interactive; then
# display help # display help
rwx_code_help rwx_code_help
# context / command # context / command
else else
local command
local function local function
# command name used to run
# (stripped from hyphen interactive flag)
command="$(basename "${0}" | sed "s|^-||")"
case "${command}" in
"bash" | "dash" | "sh") unset command ;;
*) ;;
esac
# find the matching function # find the matching function
function="$(rwx_code_command_function "${command}")" function="$(rwx_code_command_function "${command}")"
if [ -n "${function}" ]; then if [ -n "${function}" ]; then