Compare commits

..

No commits in common. "5225d6a1ae26f49941d564d278fd54c3d7694a1b" and "bcf879ddc31f020311220ed0b90a6d150ebf9de8" have entirely different histories.

4 changed files with 36 additions and 36 deletions

View file

@ -57,6 +57,18 @@ rwx_code_cache_user() {
echo "${rwx_code_cache_user}"
}
# ╭──────┬──────╮
# │ code │ help │
# ╰──────┴──────╯
# output help message
rwx_code_help() {
rwx_log "" \
"rwx_… = functions" \
" a__… = aliases" \
" u__… = user"
}
# ╭──────┬─────────╮
# │ code │ install │
# ╰──────┴─────────╯
@ -284,4 +296,26 @@ ${rwx_code_modules_user}
EOF
# load code cache
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
if rwx_shell_interactive; then
# display help
rwx_code_help
# context / command
else
local function
# find the matching function
function="$(rwx_code_command_function "${command}")"
if [ -n "${function}" ]; then
"${function}" "${@}"
fi
fi
}

View file

@ -35,10 +35,6 @@ _rwx_log() {
done
}
# ╭─────┬────────╮
# │ log │ levels │
# ╰─────┴────────╯
rwx_log_fatal() {
local code="${1}"
shift

View file

@ -53,7 +53,6 @@ rwx_main_find() {
# run required initial steps
#< core/code
#< core/shell
rwx_main_main() {
local module
local modules
@ -71,8 +70,6 @@ ${modules}
EOF
# run code module main function with found main modules
rwx_code_main "${modules}" "${@}"
# run shell module main function
rwx_shell_main
}
# run main function

View file

@ -49,14 +49,6 @@ rwx_shell_interactive=1
# │ shell │ functions │
# ╰───────┴───────────╯
# output help message
rwx_shell_help() {
rwx_log "" \
"rwx_… = functions" \
" a__… = aliases" \
" u__… = user"
}
# return current shell interactive mode
rwx_shell_interactive() {
return "${rwx_shell_interactive}"
@ -188,25 +180,6 @@ rwx_shell_main() {
esac
# configure shell
rwx_shell_configure
# context / shell
if rwx_shell_interactive; then
# display help
rwx_shell_help
# context / command
else
local command
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
function="$(rwx_code_command_function "${command}")"
if [ -n "${function}" ]; then
"${function}" "${@}"
fi
fi
}
rwx_shell_main