This commit is contained in:
parent
80949cf6c0
commit
5225d6a1ae
2 changed files with 29 additions and 33 deletions
|
@ -57,18 +57,6 @@ rwx_code_cache_user() {
|
||||||
echo "${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 │
|
# │ code │ install │
|
||||||
# ╰──────┴─────────╯
|
# ╰──────┴─────────╯
|
||||||
|
@ -296,25 +284,4 @@ ${rwx_code_modules_user}
|
||||||
EOF
|
EOF
|
||||||
# load code cache
|
# load code cache
|
||||||
rwx_code_load
|
rwx_code_load
|
||||||
# context / shell
|
|
||||||
if rwx_shell_interactive; then
|
|
||||||
# display help
|
|
||||||
rwx_code_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
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -49,6 +49,14 @@ rwx_shell_interactive=1
|
||||||
# │ shell │ functions │
|
# │ shell │ functions │
|
||||||
# ╰───────┴───────────╯
|
# ╰───────┴───────────╯
|
||||||
|
|
||||||
|
# output help message
|
||||||
|
rwx_shell_help() {
|
||||||
|
rwx_log "" \
|
||||||
|
"rwx_… = functions" \
|
||||||
|
" a__… = aliases" \
|
||||||
|
" u__… = user"
|
||||||
|
}
|
||||||
|
|
||||||
# return current shell interactive mode
|
# return current shell interactive mode
|
||||||
rwx_shell_interactive() {
|
rwx_shell_interactive() {
|
||||||
return "${rwx_shell_interactive}"
|
return "${rwx_shell_interactive}"
|
||||||
|
@ -180,4 +188,25 @@ rwx_shell_main() {
|
||||||
esac
|
esac
|
||||||
# configure shell
|
# configure shell
|
||||||
rwx_shell_configure
|
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
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue