Compare commits

..

No commits in common. "bcf879ddc31f020311220ed0b90a6d150ebf9de8" and "13ab4b8ec7700a2421fa21ed8d8b948e0acbecc2" have entirely different histories.

2 changed files with 16 additions and 35 deletions

View file

@ -6,18 +6,15 @@
# │ code │ variables │ # │ code │ variables │
# ╰──────┴───────────╯ # ╰──────┴───────────╯
# user root directory of the project
rwx_code_root="${HOME}/${RWX_MAIN_NAME}"
# main modules code cache
rwx_code_cache_main=""
# user modules code cache
rwx_code_cache_user=""
# main modules names # main modules names
rwx_code_modules_main="" rwx_code_modules_main=""
# user modules names # user modules names
rwx_code_modules_user="" rwx_code_modules_user=""
# user root directory of the project
rwx_code_root="${HOME}/${RWX_MAIN_NAME}"
# cache of all sourced code modules
_rwx_code=""
# cache for the parsing awk script # cache for the parsing awk script
_rwx_code_awk="$(cat "${rwx_main_root}/core/code.awk")" _rwx_code_awk="$(cat "${rwx_main_root}/core/code.awk")"
# cache for code aliases # cache for code aliases
@ -37,26 +34,6 @@ _rwx_code_functions=""
# cache for code variables # cache for code variables
_rwx_code_variables="" _rwx_code_variables=""
# ╭──────┬───────╮
# │ code │ cache │
# ╰──────┴───────╯
# output all cached code
rwx_code_cache() {
rwx_code_cache_main
rwx_code_cache_user
}
# output cached main code
rwx_code_cache_main() {
echo "${rwx_code_cache_main}"
}
# output cached user code
rwx_code_cache_user() {
echo "${rwx_code_cache_user}"
}
# ╭──────┬──────╮ # ╭──────┬──────╮
# │ code │ help │ # │ code │ help │
# ╰──────┴──────╯ # ╰──────┴──────╯
@ -112,6 +89,12 @@ export ENV=\"${rwx_main_path}\"
# │ code │ parts │ # │ code │ parts │
# ╰──────┴───────╯ # ╰──────┴───────╯
# show the cached code
#= rc
rwx_code() {
echo "${_rwx_code}"
}
# show the cached awk script # show the cached awk script
rwx_code_awk() { rwx_code_awk() {
echo "${_rwx_code_awk}" echo "${_rwx_code_awk}"
@ -127,7 +110,7 @@ rwx_code_aliases() {
rwx_code_command_function() { rwx_code_command_function() {
local name="${1}" local name="${1}"
[ -n "${name}" ] || return [ -n "${name}" ] || return
rwx_code_cache | rwx_code |
awk \ awk \
-v action="command function" \ -v action="command function" \
-v target="${name}" \ -v target="${name}" \
@ -212,7 +195,7 @@ rwx_code_check() {
rwx_code_doc() { rwx_code_doc() {
local name="${1}" local name="${1}"
[ -n "${name}" ] || return [ -n "${name}" ] || return
rwx_code_cache | rwx_code |
awk \ awk \
-v action="doc" \ -v action="doc" \
-v target="${name}" \ -v target="${name}" \
@ -251,7 +234,7 @@ EOF
rwx_code_parse() { rwx_code_parse() {
local action="${1}" local action="${1}"
rwx_code_cache | rwx_code |
awk \ awk \
-v action="${action}" \ -v action="${action}" \
"${_rwx_code_awk}" "${_rwx_code_awk}"
@ -277,8 +260,7 @@ EOF
# cache main modules # cache main modules
while IFS= read -r module; do while IFS= read -r module; do
# cache main module # cache main module
rwx_code_cache_main="${rwx_code_cache_main}\ _rwx_code="${_rwx_code}#. ${module}
#. ${module}
$(cat "${rwx_main_root}/${module}.${RWX_MAIN_EXTENSION}") $(cat "${rwx_main_root}/${module}.${RWX_MAIN_EXTENSION}")
" "
done <<EOF done <<EOF
@ -287,8 +269,7 @@ EOF
# cache user modules # cache user modules
while IFS= read -r module; do while IFS= read -r module; do
# cache user module # cache user module
rwx_code_cache_user="${rwx_code_cache_user}\ _rwx_code="${_rwx_code}#. ${module}
#. ${module}
$(cat "${rwx_code_root}/${module}.${RWX_MAIN_EXTENSION}") $(cat "${rwx_code_root}/${module}.${RWX_MAIN_EXTENSION}")
" "
done <<EOF done <<EOF

View file

@ -43,7 +43,7 @@ rwx_test_doc() {
\ \
"RWX_MAIN_MODULE" \ "RWX_MAIN_MODULE" \
\ \
"rwx_code_cache_main" \ "_rwx_code" \
\ \
"rwx_main_cache" \ "rwx_main_cache" \
\ \