diff --git a/readme.md b/readme.md index 9a09ee7..db7e87d 100644 --- a/readme.md +++ b/readme.md @@ -117,6 +117,6 @@ Two interpreted languages for flexibility. * get unresolved path for new panes & windows * fully working doc function algorithm * self install aliases -* transfer all parsings to awk +* list aliases ### 6.2 [Further tasks](#when) {#when-further} diff --git a/sh/code.awk b/sh/code.awk index 053f1be..b8a8f59 100644 --- a/sh/code.awk +++ b/sh/code.awk @@ -46,11 +46,7 @@ BEGIN { } { - if (action == "aliases") { - if (match($0, RE_ALIAS, m)) { - print m[1] - } - } else if (action == "aliases functions") { + if (action == "alias") { if (match($0, RE_ALIAS, m)) { append(m[1]) } else if (match($0, RE_FUNCTION, m)) { diff --git a/sh/code.sh b/sh/code.sh index 8838276..2c4c5ed 100644 --- a/sh/code.sh +++ b/sh/code.sh @@ -19,23 +19,12 @@ rwx_code() { echo "${_rwx_code}" } -# show the cached aliases -#= rca -rwx_code_aliases() { - echo "${_rwx_code_aliases}" -} - # show the cached aliases and functions #= rcaf rwx_code_aliases_functions() { echo "${_rwx_code_aliases_functions}" } -# show the cached awk script -rwx_code_awk() { - echo "${_rwx_code_awk}" -} - # show the cached constants #= rcc rwx_code_constants() { @@ -77,5 +66,5 @@ rwx_code_doc() { awk \ --assign action="doc" \ --assign target="${name}" \ - "$(rwx_code_awk)" + "${_rwx_code_awk}" } diff --git a/sh/main.sh b/sh/main.sh index 8fe2884..f1be786 100755 --- a/sh/main.sh +++ b/sh/main.sh @@ -202,9 +202,7 @@ ${RWX_REGEX_BEGIN}\\(${RWX_REGEX_VARIABLE}\\)${RWX_REGEX_SET}" _rwx_code_variables="" rwx_parse_code() { - # parse aliases - _rwx_code_aliases="$(rwx_parse_aliases)" - # parse aliases functions + # parse aliases commands local line text _rwx_code_aliases_functions="$(rwx_parse_aliases_functions)" while IFS= read -r line; do @@ -221,17 +219,11 @@ EOF # parse variables _rwx_code_variables="$(rwx_parse_variables)" } -rwx_parse_aliases() { - echo "${_rwx_code}" | - awk \ - --assign action="aliases" \ - "$(rwx_code_awk)" -} rwx_parse_aliases_functions() { printf "%s" "${_rwx_code}" | awk \ - --assign action="aliases functions" \ - "$(rwx_code_awk)" + --assign action="alias" \ + "${_rwx_code_awk}" } rwx_parse_constants() { printf "%s" "${_rwx_code}" | diff --git a/sh/test.sh b/sh/test.sh index d017077..dee1a65 100644 --- a/sh/test.sh +++ b/sh/test.sh @@ -16,12 +16,11 @@ rwx_test() { rwx_test_code() { local items set \ - "awk" \ "constants" \ "variables" \ "functions" \ - "aliases" \ "aliases_functions" \ + "aliases" \ rwx_code for items in "${@}"; do