From b47e6ec7dee0af0a4a3311e819a84f7068ca54fa Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sun, 6 Jul 2025 22:39:57 +0200 Subject: [PATCH 01/20] self/test --- sh/main.sh | 25 ------------------------- sh/self.sh | 24 ++++++++++++++++++++++++ 2 files changed, 24 insertions(+), 25 deletions(-) diff --git a/sh/main.sh b/sh/main.sh index 22344e8..e873a94 100755 --- a/sh/main.sh +++ b/sh/main.sh @@ -231,31 +231,6 @@ rwx_parse_variables() { sed --silent "s|${RWX_REGEX_TARGET_VARIABLE}|\\1|p" } -# ╭──────┬──────╮ -# │ main │ test │ -# ╰──────┴──────╯ - -#= rt -rwx_test() { - local item - set \ - "main" \ - "alias/git" \ - \ - "RWX_MAIN_NAME" \ - \ - "_rwx_code" \ - \ - "rwx_cache" \ - \ - "alias/batcat" \ - "b" - for item in "${@}"; do - echo - rwx_doc "${item}" - done -} - # ╭──────┬─────╮ # │ main │ run │ # ╰──────┴─────╯ diff --git a/sh/self.sh b/sh/self.sh index f4ecd69..58011d8 100644 --- a/sh/self.sh +++ b/sh/self.sh @@ -166,6 +166,30 @@ rwx_self_subset() { done } +# ╭──────┬──────╮ +# │ self │ test │ +# ╰──────┴──────╯ + +rwx_self_test() { + local item + set \ + "main" \ + "alias/git" \ + \ + "RWX_MAIN_NAME" \ + \ + "_rwx_code" \ + \ + "rwx_cache" \ + \ + "alias/batcat" \ + "b" + for item in "${@}"; do + echo + rwx_doc "${item}" + done +} + # ╭──────┬───────╮ # │ self │ write │ # ╰──────┴───────╯ From 4c5ac91ac3098a1030615075cb95616a085bf219 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sun, 6 Jul 2025 22:42:40 +0200 Subject: [PATCH 02/20] \ --- sh/self.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sh/self.sh b/sh/self.sh index 58011d8..6233eb2 100644 --- a/sh/self.sh +++ b/sh/self.sh @@ -170,6 +170,7 @@ rwx_self_subset() { # │ self │ test │ # ╰──────┴──────╯ +#= rst rwx_self_test() { local item set \ @@ -183,7 +184,8 @@ rwx_self_test() { "rwx_cache" \ \ "alias/batcat" \ - "b" + "b" \ + for item in "${@}"; do echo rwx_doc "${item}" From 8a6c02a2628779207151e3cedfc80c9a93b6832d Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sun, 6 Jul 2025 22:52:08 +0200 Subject: [PATCH 03/20] code/constants --- sh/main.sh | 2 +- sh/self.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sh/main.sh b/sh/main.sh index e873a94..79bdabd 100755 --- a/sh/main.sh +++ b/sh/main.sh @@ -206,7 +206,7 @@ rwx_parse_code() { ${RWX_ALIASES} EOF # parse constants - RWX_CONSTANTS="$(rwx_parse_constants)" + _rwx_code_constants="$(rwx_parse_constants)" # parse functions RWX_FUNCTIONS="$(rwx_parse_functions)" # parse variables diff --git a/sh/self.sh b/sh/self.sh index 6233eb2..adf266e 100644 --- a/sh/self.sh +++ b/sh/self.sh @@ -16,7 +16,7 @@ rwx_code_aliases() { # show the cached constants #= rcc rwx_code_constants() { - echo "${RWX_CONSTANTS}" + echo "${_rwx_code_constants}" } # show the cached functions From 1dd525b86c5d5ce2766ef65fc554c35d55ef7157 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sun, 6 Jul 2025 22:54:44 +0200 Subject: [PATCH 04/20] code/functions --- sh/main.sh | 2 +- sh/self.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sh/main.sh b/sh/main.sh index 79bdabd..89c915a 100755 --- a/sh/main.sh +++ b/sh/main.sh @@ -208,7 +208,7 @@ EOF # parse constants _rwx_code_constants="$(rwx_parse_constants)" # parse functions - RWX_FUNCTIONS="$(rwx_parse_functions)" + _rwx_code_functions="$(rwx_parse_functions)" # parse variables _rwx_code_variables="$(rwx_parse_variables)" } diff --git a/sh/self.sh b/sh/self.sh index adf266e..6ebb759 100644 --- a/sh/self.sh +++ b/sh/self.sh @@ -22,7 +22,7 @@ rwx_code_constants() { # show the cached functions #= rcf rwx_code_functions() { - echo "${RWX_FUNCTIONS}" + echo "${_rwx_code_functions}" } # show the cached variables From 6b7598eb609dea574c59db6c9909257513c6adbf Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sun, 6 Jul 2025 23:09:41 +0200 Subject: [PATCH 05/20] code --- sh/code.sh | 8 ++++++++ sh/self.sh | 6 ------ 2 files changed, 8 insertions(+), 6 deletions(-) create mode 100644 sh/code.sh diff --git a/sh/code.sh b/sh/code.sh new file mode 100644 index 0000000..a8a09d4 --- /dev/null +++ b/sh/code.sh @@ -0,0 +1,8 @@ +# code +# module + +# show the cached code +#= rc +rwx_code() { + echo "${_rwx_code}" +} diff --git a/sh/self.sh b/sh/self.sh index 6ebb759..156d103 100644 --- a/sh/self.sh +++ b/sh/self.sh @@ -1,12 +1,6 @@ # self # module -# show the cached code -#= rc -rwx_code() { - echo "${_rwx_code}" -} - # show the cached aliases #= rca rwx_code_aliases() { From abca96719bce4ce91e952fca50a456237ba43a6e Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sun, 6 Jul 2025 23:10:52 +0200 Subject: [PATCH 06/20] code/constants --- sh/code.sh | 6 ++++++ sh/self.sh | 6 ------ 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/sh/code.sh b/sh/code.sh index a8a09d4..59508c0 100644 --- a/sh/code.sh +++ b/sh/code.sh @@ -6,3 +6,9 @@ rwx_code() { echo "${_rwx_code}" } + +# show the cached constants +#= rcc +rwx_code_constants() { + echo "${_rwx_code_constants}" +} diff --git a/sh/self.sh b/sh/self.sh index 156d103..8a14529 100644 --- a/sh/self.sh +++ b/sh/self.sh @@ -7,12 +7,6 @@ rwx_code_aliases() { echo "${RWX_ALIASES}" } -# show the cached constants -#= rcc -rwx_code_constants() { - echo "${_rwx_code_constants}" -} - # show the cached functions #= rcf rwx_code_functions() { From d7bdca5f128d1f7cf76841b3f07b471583600c23 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sun, 6 Jul 2025 23:11:25 +0200 Subject: [PATCH 07/20] code/functions --- sh/code.sh | 6 ++++++ sh/self.sh | 6 ------ 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/sh/code.sh b/sh/code.sh index 59508c0..c4cef2d 100644 --- a/sh/code.sh +++ b/sh/code.sh @@ -12,3 +12,9 @@ rwx_code() { rwx_code_constants() { echo "${_rwx_code_constants}" } + +# show the cached functions +#= rcf +rwx_code_functions() { + echo "${_rwx_code_functions}" +} diff --git a/sh/self.sh b/sh/self.sh index 8a14529..b683214 100644 --- a/sh/self.sh +++ b/sh/self.sh @@ -7,12 +7,6 @@ rwx_code_aliases() { echo "${RWX_ALIASES}" } -# show the cached functions -#= rcf -rwx_code_functions() { - echo "${_rwx_code_functions}" -} - # show the cached variables #= rcv rwx_code_variables() { From 4a2a24a1b6b9da8f3718b356d693039a26fd514e Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sun, 6 Jul 2025 23:15:48 +0200 Subject: [PATCH 08/20] code/check --- sh/code.sh | 18 ++++++++++++++++++ sh/self.sh | 14 -------------- 2 files changed, 18 insertions(+), 14 deletions(-) diff --git a/sh/code.sh b/sh/code.sh index c4cef2d..8f6851f 100644 --- a/sh/code.sh +++ b/sh/code.sh @@ -1,6 +1,10 @@ # code # module +# ╭──────╮ +# │ code │ +# ╰──────╯ + # show the cached code #= rc rwx_code() { @@ -18,3 +22,17 @@ rwx_code_constants() { rwx_code_functions() { echo "${_rwx_code_functions}" } + +# ╭──────┬───────╮ +# │ code │ check │ +# ╰──────┴───────╯ + +# check source code +rwx_code_check() { + # check format + rwx_log + rwx_shfmt "${RWX_ROOT_SYSTEM}" + # check syntax + rwx_log + rwx_shellcheck "${RWX_ROOT_SYSTEM}" +} diff --git a/sh/self.sh b/sh/self.sh index b683214..e25add3 100644 --- a/sh/self.sh +++ b/sh/self.sh @@ -25,20 +25,6 @@ rwx_doc() { --file "${RWX_AWK}" } -# ╭──────┬───────╮ -# │ self │ check │ -# ╰──────┴───────╯ - -# check source code -rwx_self_check() { - # check format - rwx_log - rwx_shfmt "${RWX_ROOT_SYSTEM}" - # check syntax - rwx_log - rwx_shellcheck "${RWX_ROOT_SYSTEM}" -} - # ╭──────┬──────────╮ # │ self │ commands │ # ╰──────┴──────────╯ From a40f086d10632e4008ae5d7e8becedb708b12b51 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sun, 6 Jul 2025 23:17:32 +0200 Subject: [PATCH 09/20] =?UTF-8?q?=E2=88=92useless?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sh/self.sh | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/sh/self.sh b/sh/self.sh index e25add3..61d165e 100644 --- a/sh/self.sh +++ b/sh/self.sh @@ -39,19 +39,6 @@ rwx_self_commands() { sed "s|^${RWX_SELF_COMMAND}||" } -# ╭──────┬───────────╮ -# │ self │ functions │ -# ╰──────┴───────────╯ - -# get functions from root -rwx_self_functions() { - grep \ - --directories "recurse" \ - --no-filename \ - "()" "${RWX_ROOT_SYSTEM}" | - cut --delimiter "(" --fields 1 -} - # ╭──────┬──────╮ # │ self │ help │ # ╰──────┴──────╯ From fed8a38bc11364667639c1be4d5288ba23e8a33d Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Mon, 7 Jul 2025 00:00:06 +0200 Subject: [PATCH 10/20] main/deps --- sh/main.sh | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/sh/main.sh b/sh/main.sh index 89c915a..e40ea7a 100755 --- a/sh/main.sh +++ b/sh/main.sh @@ -3,6 +3,15 @@ # │ main │ # ╰──────╯ # main module +# * builtins +# * echo +# * printf +# * read +# * binaries +# * awk +# * cat +# * find +# * sed # ╭──────┬───────────╮ # │ main │ constants │ From 7d400d9031b04959601fec9ffe498eeb2bffa243 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Mon, 7 Jul 2025 00:01:06 +0200 Subject: [PATCH 11/20] code/variables --- sh/code.sh | 6 ++++++ sh/self.sh | 6 ------ 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/sh/code.sh b/sh/code.sh index 8f6851f..59c9bb5 100644 --- a/sh/code.sh +++ b/sh/code.sh @@ -23,6 +23,12 @@ rwx_code_functions() { echo "${_rwx_code_functions}" } +# show the cached variables +#= rcv +rwx_code_variables() { + echo "${_rwx_code_variables}" +} + # ╭──────┬───────╮ # │ code │ check │ # ╰──────┴───────╯ diff --git a/sh/self.sh b/sh/self.sh index 61d165e..46db7c7 100644 --- a/sh/self.sh +++ b/sh/self.sh @@ -7,12 +7,6 @@ rwx_code_aliases() { echo "${RWX_ALIASES}" } -# show the cached variables -#= rcv -rwx_code_variables() { - echo "${_rwx_code_variables}" -} - # meta doc #= rd rwx_doc() { From e157a1ecf77a5ecd9aee4b369da583e418ac27b4 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Mon, 7 Jul 2025 00:17:58 +0200 Subject: [PATCH 12/20] code/aliases_commands --- sh/code.sh | 6 ++++++ sh/main.sh | 6 +++--- sh/self.sh | 6 ------ 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/sh/code.sh b/sh/code.sh index 59c9bb5..54682bc 100644 --- a/sh/code.sh +++ b/sh/code.sh @@ -11,6 +11,12 @@ rwx_code() { echo "${_rwx_code}" } +# show the cached aliases +#= rcac +rwx_code_aliases_commands() { + echo "${_rwx_code_aliases_commands}" +} + # show the cached constants #= rcc rwx_code_constants() { diff --git a/sh/main.sh b/sh/main.sh index e40ea7a..0295692 100755 --- a/sh/main.sh +++ b/sh/main.sh @@ -204,9 +204,9 @@ ${RWX_REGEX_BEGIN}\\(${RWX_REGEX_VARIABLE}\\)${RWX_REGEX_SET}" _rwx_code_variables="" rwx_parse_code() { - # parse aliases + # parse aliases commands local line text - RWX_ALIASES="$(rwx_parse_aliases)" + _rwx_code_aliases_commands="$(rwx_parse_aliases_commands)" while IFS= read -r line; do text="$(echo "${line}" | sed "s| |() { |")" text="${text} \"\${@}\"; }" @@ -221,7 +221,7 @@ EOF # parse variables _rwx_code_variables="$(rwx_parse_variables)" } -rwx_parse_aliases() { +rwx_parse_aliases_commands() { printf "%s" "${_rwx_code}" | awk \ --assign action="alias" \ diff --git a/sh/self.sh b/sh/self.sh index 46db7c7..0588991 100644 --- a/sh/self.sh +++ b/sh/self.sh @@ -1,12 +1,6 @@ # self # module -# show the cached aliases -#= rca -rwx_code_aliases() { - echo "${RWX_ALIASES}" -} - # meta doc #= rd rwx_doc() { From 060a84abda96873596f6f8774c38e4e92f3fdaa2 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Mon, 7 Jul 2025 00:29:50 +0200 Subject: [PATCH 13/20] test/doc --- sh/code.sh | 20 ++++++++++++++++---- sh/main.sh | 4 ++-- sh/self.sh | 38 -------------------------------------- sh/test.sh | 33 +++++++++++++++++++++++++++++++++ 4 files changed, 51 insertions(+), 44 deletions(-) create mode 100644 sh/test.sh diff --git a/sh/code.sh b/sh/code.sh index 54682bc..c246878 100644 --- a/sh/code.sh +++ b/sh/code.sh @@ -11,10 +11,10 @@ rwx_code() { echo "${_rwx_code}" } -# show the cached aliases -#= rcac -rwx_code_aliases_commands() { - echo "${_rwx_code_aliases_commands}" +# show the cached aliases and functions +#= rcaf +rwx_code_aliases_functions() { + echo "${_rwx_code_aliases_functions}" } # show the cached constants @@ -48,3 +48,15 @@ rwx_code_check() { rwx_log rwx_shellcheck "${RWX_ROOT_SYSTEM}" } + +# fetch matching doc for given name +#= rcd +rwx_code_doc() { + local name="${1}" + [ -n "${name}" ] || return + printf "%s" "${_rwx_code}" | + awk \ + --assign action="doc" \ + --assign target="${name}" \ + --file "${RWX_AWK}" +} diff --git a/sh/main.sh b/sh/main.sh index 0295692..b01c84c 100755 --- a/sh/main.sh +++ b/sh/main.sh @@ -206,7 +206,7 @@ _rwx_code_variables="" rwx_parse_code() { # parse aliases commands local line text - _rwx_code_aliases_commands="$(rwx_parse_aliases_commands)" + _rwx_code_aliases_functions="$(rwx_parse_aliases_functions)" while IFS= read -r line; do text="$(echo "${line}" | sed "s| |() { |")" text="${text} \"\${@}\"; }" @@ -221,7 +221,7 @@ EOF # parse variables _rwx_code_variables="$(rwx_parse_variables)" } -rwx_parse_aliases_commands() { +rwx_parse_aliases_functions() { printf "%s" "${_rwx_code}" | awk \ --assign action="alias" \ diff --git a/sh/self.sh b/sh/self.sh index 0588991..0752da9 100644 --- a/sh/self.sh +++ b/sh/self.sh @@ -1,18 +1,6 @@ # self # module -# meta doc -#= rd -rwx_doc() { - local name="${1}" - [ -n "${name}" ] || return - printf "%s" "${_rwx_code}" | - awk \ - --assign action="doc" \ - --assign target="${name}" \ - --file "${RWX_AWK}" -} - # ╭──────┬──────────╮ # │ self │ commands │ # ╰──────┴──────────╯ @@ -109,32 +97,6 @@ rwx_self_subset() { done } -# ╭──────┬──────╮ -# │ self │ test │ -# ╰──────┴──────╯ - -#= rst -rwx_self_test() { - local item - set \ - "main" \ - "alias/git" \ - \ - "RWX_MAIN_NAME" \ - \ - "_rwx_code" \ - \ - "rwx_cache" \ - \ - "alias/batcat" \ - "b" \ - - for item in "${@}"; do - echo - rwx_doc "${item}" - done -} - # ╭──────┬───────╮ # │ self │ write │ # ╰──────┴───────╯ diff --git a/sh/test.sh b/sh/test.sh new file mode 100644 index 0000000..b18a696 --- /dev/null +++ b/sh/test.sh @@ -0,0 +1,33 @@ +# test +# module +# * code +# * doc + +# ╭──────┬──────╮ +# │ test │ code │ +# ╰──────┴──────╯ + +# ╭──────┬─────╮ +# │ test │ doc │ +# ╰──────┴─────╯ + +rwx_test_doc() { + local item + set \ + "main" \ + "alias/git" \ + \ + "RWX_MAIN_NAME" \ + \ + "_rwx_code" \ + \ + "rwx_cache" \ + \ + "alias/batcat" \ + "b" \ + + for item in "${@}"; do + echo + rwx_code_doc "${item}" + done +} From 77cb7d2bb1e7eb0c4c0c864a76940eb7733f801a Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Mon, 7 Jul 2025 00:33:55 +0200 Subject: [PATCH 14/20] test/code --- sh/test.sh | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/sh/test.sh b/sh/test.sh index b18a696..7e9a8b7 100644 --- a/sh/test.sh +++ b/sh/test.sh @@ -1,5 +1,6 @@ -# test -# module +# ╭──────╮ +# │ test │ +# ╰──────╯ # * code # * doc @@ -7,6 +8,22 @@ # │ test │ code │ # ╰──────┴──────╯ +rwx_test_code() { + local items + set \ + "constants" \ + "variables" \ + "functions" \ + "aliases_functions" \ + "aliases" \ + + rwx_code + for items in "${@}"; do + echo + "rwx_code_${items}" + done +} + # ╭──────┬─────╮ # │ test │ doc │ # ╰──────┴─────╯ From 76e222c60d48c9a8e360a4012f1f1fef59c32b42 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Mon, 7 Jul 2025 00:35:00 +0200 Subject: [PATCH 15/20] test --- sh/test.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sh/test.sh b/sh/test.sh index 7e9a8b7..4862304 100644 --- a/sh/test.sh +++ b/sh/test.sh @@ -4,6 +4,11 @@ # * code # * doc +rwx_test() { + rwx_code_code + rwx_code_doc +} + # ╭──────┬──────╮ # │ test │ code │ # ╰──────┴──────╯ From 98a46e246ead7c15edd3e258731e7f9fa41632b8 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Mon, 7 Jul 2025 00:40:25 +0200 Subject: [PATCH 16/20] log/info --- sh/log/log.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sh/log/log.sh b/sh/log/log.sh index a7bb0f4..a3013e8 100644 --- a/sh/log/log.sh +++ b/sh/log/log.sh @@ -23,6 +23,8 @@ RWX_LOG_LEVEL=${RWX_LOG_LEVEL_INFO} # │ log │ log │ # ╰─────┴─────╯ +rwx_log() { rwx_log_info "${@}"; } + rwx_log_debug() { if [ "${RWX_LOG_LEVEL}" -ge "${RWX_LOG_LEVEL_DEBUG}" ]; then _rwx_log "[DEBUG]" "${@}" @@ -49,7 +51,6 @@ rwx_log_fatal() { fi } -#= rwx_log rwx_log_info() { if [ "${RWX_LOG_LEVEL}" -ge "${RWX_LOG_LEVEL_INFO}" ]; then _rwx_log "" "${@}" From 2a31766869d3b999b36d3e7318398aa1a7626ade Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Mon, 7 Jul 2025 00:42:27 +0200 Subject: [PATCH 17/20] fix --- sh/main.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sh/main.sh b/sh/main.sh index b01c84c..8cca344 100755 --- a/sh/main.sh +++ b/sh/main.sh @@ -212,7 +212,7 @@ rwx_parse_code() { text="${text} \"\${@}\"; }" eval "${text}" done < Date: Mon, 7 Jul 2025 00:43:19 +0200 Subject: [PATCH 18/20] fix --- sh/test.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sh/test.sh b/sh/test.sh index 4862304..dee1a65 100644 --- a/sh/test.sh +++ b/sh/test.sh @@ -5,8 +5,8 @@ # * doc rwx_test() { - rwx_code_code - rwx_code_doc + rwx_test_code + rwx_test_doc } # ╭──────┬──────╮ From be43cb7fe1c1244127c3d1deeb7d4a1150b6631b Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Mon, 7 Jul 2025 00:52:25 +0200 Subject: [PATCH 19/20] readme/tasks --- readme.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/readme.md b/readme.md index 532211c..437006d 100644 --- a/readme.md +++ b/readme.md @@ -117,5 +117,7 @@ Two interpreted languages for flexibility. * get unresolved path for new panes & windows * fully working doc function algorithm * self install aliases +* cache awk code +* list aliases ### 6.2 [Further tasks](#when) {#when-further} From 2f7dd63c7464c20815f4edb62e523fc937a4c522 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Mon, 7 Jul 2025 01:13:06 +0200 Subject: [PATCH 20/20] code/awk --- readme.md | 1 - sh/{main.awk => code.awk} | 0 sh/code.sh | 18 +++++++++++++----- sh/main.sh | 4 +--- 4 files changed, 14 insertions(+), 9 deletions(-) rename sh/{main.awk => code.awk} (100%) diff --git a/readme.md b/readme.md index 437006d..db7e87d 100644 --- a/readme.md +++ b/readme.md @@ -117,7 +117,6 @@ Two interpreted languages for flexibility. * get unresolved path for new panes & windows * fully working doc function algorithm * self install aliases -* cache awk code * list aliases ### 6.2 [Further tasks](#when) {#when-further} diff --git a/sh/main.awk b/sh/code.awk similarity index 100% rename from sh/main.awk rename to sh/code.awk diff --git a/sh/code.sh b/sh/code.sh index c246878..2c4c5ed 100644 --- a/sh/code.sh +++ b/sh/code.sh @@ -1,10 +1,18 @@ -# code -# module - # ╭──────╮ # │ code │ # ╰──────╯ +# ╭──────┬───────────╮ +# │ code │ variables │ +# ╰──────┴───────────╯ + +# path to the required parsing awk script +_rwx_code_awk="$(cat "${RWX_ROOT_SYSTEM}/code.awk")" + +# ╭──────┬───────╮ +# │ code │ parts │ +# ╰──────┴───────╯ + # show the cached code #= rc rwx_code() { @@ -36,7 +44,7 @@ rwx_code_variables() { } # ╭──────┬───────╮ -# │ code │ check │ +# │ code │ parse │ # ╰──────┴───────╯ # check source code @@ -58,5 +66,5 @@ rwx_code_doc() { awk \ --assign action="doc" \ --assign target="${name}" \ - --file "${RWX_AWK}" + "${_rwx_code_awk}" } diff --git a/sh/main.sh b/sh/main.sh index 8cca344..f1be786 100755 --- a/sh/main.sh +++ b/sh/main.sh @@ -45,8 +45,6 @@ RWX_ROOT_SYSTEM="/usr/local/lib/${RWX_SELF_NAME}" # user root directory of the project RWX_SELF_USER="${HOME}/${RWX_SELF_NAME}" -# path to the required parsing awk script -RWX_AWK="${RWX_ROOT_SYSTEM}/${RWX_MAIN_NAME%.sh}.awk" # path to the entrypoint main file of the project RWX_MAIN_PATH="${RWX_ROOT_SYSTEM}/${RWX_MAIN_NAME}" @@ -225,7 +223,7 @@ rwx_parse_aliases_functions() { printf "%s" "${_rwx_code}" | awk \ --assign action="alias" \ - --file "${RWX_AWK}" + "${_rwx_code_awk}" } rwx_parse_constants() { printf "%s" "${_rwx_code}" |