context/command,shell
This commit is contained in:
parent
68ec08871c
commit
1eb130320e
1 changed files with 6 additions and 15 deletions
21
sh/main.sh
21
sh/main.sh
|
@ -131,13 +131,11 @@ rwx_main() {
|
||||||
fi
|
fi
|
||||||
# user root
|
# user root
|
||||||
rwx_source "${RWX_SELF_USER}"
|
rwx_source "${RWX_SELF_USER}"
|
||||||
#
|
# context / command
|
||||||
local argument
|
if [ -n "${RWX_COMMAND_NAME}" ]; then
|
||||||
argument="$(echo "${0}" | sed "s|^-||")"
|
"${RWX_SELF_COMMAND}${RWX_COMMAND_NAME}" "${@}"
|
||||||
case "${argument}" in
|
# context / shell
|
||||||
"bash" | \
|
else
|
||||||
"dash" | \
|
|
||||||
"sh")
|
|
||||||
# run interactive extras
|
# run interactive extras
|
||||||
if rwx_shell_interactive; then
|
if rwx_shell_interactive; then
|
||||||
# check format
|
# check format
|
||||||
|
@ -150,14 +148,7 @@ rwx_main() {
|
||||||
rwx_log
|
rwx_log
|
||||||
rwx_self_help
|
rwx_self_help
|
||||||
fi
|
fi
|
||||||
;;
|
fi
|
||||||
*)
|
|
||||||
local function name
|
|
||||||
name="$(basename "${argument}")"
|
|
||||||
function="${RWX_SELF_COMMAND}${name}"
|
|
||||||
"${function}" "${@}"
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# run main function
|
# run main function
|
||||||
|
|
Loading…
Reference in a new issue