diff --git a/sh/code.awk b/sh/code.awk index 053f1be..8a3208f 100644 --- a/sh/code.awk +++ b/sh/code.awk @@ -50,6 +50,10 @@ BEGIN { if (match($0, RE_ALIAS, m)) { print m[1] } + } else if (action == "functions") { + if (match($0, RE_FUNCTION, m)) { + print m[1] + } } else if (action == "aliases functions") { if (match($0, RE_ALIAS, m)) { append(m[1]) diff --git a/sh/main.sh b/sh/main.sh index 8fe2884..7d3f4b7 100755 --- a/sh/main.sh +++ b/sh/main.sh @@ -238,8 +238,10 @@ rwx_parse_constants() { sed --silent "s|${RWX_REGEX_TARGET_CONSTANT}|\\1|p" } rwx_parse_functions() { - printf "%s" "${_rwx_code}" | - sed --silent "s|${RWX_REGEX_TARGET_FUNCTION}|\\1|p" + echo "${_rwx_code}" | + awk \ + --assign action="functions" \ + "$(rwx_code_awk)" } rwx_parse_variables() { printf "%s" "${_rwx_code}" |