From ff077a039a17129c1471cb45089c9810c778a5f3 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Mon, 25 Nov 2024 21:00:14 +0100 Subject: [PATCH] grep_functions --- sh/main.sh | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/sh/main.sh b/sh/main.sh index 7921bce..bc3fecc 100644 --- a/sh/main.sh +++ b/sh/main.sh @@ -40,12 +40,6 @@ _sh_main_log() { # sort -_sh_main_commands() { - local file="${1}" - grep "()" "${file}" | - cut --delimiter "(" --fields 1 -} - main_source_directory() { local path="${1}" [ -d "${path}" ] || @@ -62,7 +56,7 @@ main_source_directory() { module="${path}/${module}" # shellcheck disable=SC1090 . "${module}" - cmd="$(_sh_main_commands "${module}")" + cmd="$(sh_grep_functions "${module}")" if [ -n "${cmd}" ]; then [ -n "${CMD}" ] && CMD="${CMD} " @@ -95,6 +89,12 @@ sh_find_sh() { sh_find_extension "sh" "${@}" } +sh_grep_functions() { + local file="${1}" + grep "()" "${file}" | + cut --delimiter "(" --fields 1 +} + sh_help() { sh_log \ "sh_… = shell functions" \