From bcf879ddc31f020311220ed0b90a6d150ebf9de8 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Thu, 10 Jul 2025 02:59:25 +0200 Subject: [PATCH] code/cache --- sh/core/code.sh | 14 +++----------- sh/test.sh | 2 +- 2 files changed, 4 insertions(+), 12 deletions(-) diff --git a/sh/core/code.sh b/sh/core/code.sh index 5e1cf09..c87ad35 100644 --- a/sh/core/code.sh +++ b/sh/core/code.sh @@ -18,8 +18,6 @@ rwx_code_modules_main="" # user modules names rwx_code_modules_user="" -# cache of all sourced code modules -_rwx_code="" # cache for the parsing awk script _rwx_code_awk="$(cat "${rwx_main_root}/core/code.awk")" # cache for code aliases @@ -114,12 +112,6 @@ export ENV=\"${rwx_main_path}\" # │ code │ parts │ # ╰──────┴───────╯ -# show the cached code -#= rc -rwx_code() { - echo "${_rwx_code}" -} - # show the cached awk script rwx_code_awk() { echo "${_rwx_code_awk}" @@ -135,7 +127,7 @@ rwx_code_aliases() { rwx_code_command_function() { local name="${1}" [ -n "${name}" ] || return - rwx_code | + rwx_code_cache | awk \ -v action="command function" \ -v target="${name}" \ @@ -220,7 +212,7 @@ rwx_code_check() { rwx_code_doc() { local name="${1}" [ -n "${name}" ] || return - rwx_code | + rwx_code_cache | awk \ -v action="doc" \ -v target="${name}" \ @@ -259,7 +251,7 @@ EOF rwx_code_parse() { local action="${1}" - rwx_code | + rwx_code_cache | awk \ -v action="${action}" \ "${_rwx_code_awk}" diff --git a/sh/test.sh b/sh/test.sh index 1ef31ec..b7385f2 100644 --- a/sh/test.sh +++ b/sh/test.sh @@ -43,7 +43,7 @@ rwx_test_doc() { \ "RWX_MAIN_MODULE" \ \ - "_rwx_code" \ + "rwx_code_cache_main" \ \ "rwx_main_cache" \ \