diff --git a/sh/code.sh b/sh/code.sh index 31339f6..e5a898b 100644 --- a/sh/code.sh +++ b/sh/code.sh @@ -92,10 +92,10 @@ rwx_code_doc() { rwx_code_load() { # parse aliases - _rwx_code_aliases="$(rwx_parse_aliases)" + _rwx_code_aliases="$(rwx_code_parse "aliases")" # parse aliases functions local line text - _rwx_code_aliases_functions="$(rwx_parse_aliases_functions)" + _rwx_code_aliases_functions="$(rwx_code_parse "aliases functions")" while IFS= read -r line; do text="$(echo "${line}" | sed "s| |() { |")" text="${text} \"\${@}\"; }" @@ -104,11 +104,11 @@ rwx_code_load() { ${_rwx_code_aliases_functions} EOF # parse constants - _rwx_code_constants="$(rwx_parse_constants)" + _rwx_code_constants="$(rwx_code_parse "constants")" # parse functions - _rwx_code_functions="$(rwx_parse_functions)" + _rwx_code_functions="$(rwx_code_parse "functions")" # parse variables - _rwx_code_variables="$(rwx_parse_variables)" + _rwx_code_variables="$(rwx_code_parse "variables")" } rwx_code_parse() { @@ -118,34 +118,3 @@ rwx_code_parse() { --assign action="${action}" \ "${_rwx_code_awk}" } - -rwx_parse_aliases() { - rwx_code | - awk \ - --assign action="aliases" \ - "${_rwx_code_awk}" -} -rwx_parse_aliases_functions() { - rwx_code | - awk \ - --assign action="aliases functions" \ - "${_rwx_code_awk}" -} -rwx_parse_constants() { - rwx_code | - awk \ - --assign action="constants" \ - "${_rwx_code_awk}" -} -rwx_parse_functions() { - rwx_code | - awk \ - --assign action="functions" \ - "${_rwx_code_awk}" -} -rwx_parse_variables() { - rwx_code | - awk \ - --assign action="variables" \ - "${_rwx_code_awk}" -}