grep_functions

This commit is contained in:
Marc Beninca 2024-11-25 21:00:14 +01:00
parent ff7f64e670
commit ff077a039a
Signed by: marc.beninca
GPG key ID: 9C7613450C80C24F

View file

@ -40,12 +40,6 @@ _sh_main_log() {
# sort # sort
_sh_main_commands() {
local file="${1}"
grep "()" "${file}" |
cut --delimiter "(" --fields 1
}
main_source_directory() { main_source_directory() {
local path="${1}" local path="${1}"
[ -d "${path}" ] || [ -d "${path}" ] ||
@ -62,7 +56,7 @@ main_source_directory() {
module="${path}/${module}" module="${path}/${module}"
# shellcheck disable=SC1090 # shellcheck disable=SC1090
. "${module}" . "${module}"
cmd="$(_sh_main_commands "${module}")" cmd="$(sh_grep_functions "${module}")"
if [ -n "${cmd}" ]; then if [ -n "${cmd}" ]; then
[ -n "${CMD}" ] && CMD="${CMD} [ -n "${CMD}" ] && CMD="${CMD}
" "
@ -95,6 +89,12 @@ sh_find_sh() {
sh_find_extension "sh" "${@}" sh_find_extension "sh" "${@}"
} }
sh_grep_functions() {
local file="${1}"
grep "()" "${file}" |
cut --delimiter "(" --fields 1
}
sh_help() { sh_help() {
sh_log \ sh_log \
"sh_… = shell functions" \ "sh_… = shell functions" \