From 13e89092e4cdea1a4fbad0873803d4e80e7524a9 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Mon, 25 Nov 2024 20:40:57 +0100 Subject: [PATCH] public/find --- sh/main.sh | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/sh/main.sh b/sh/main.sh index e4f45ba..99882a7 100644 --- a/sh/main.sh +++ b/sh/main.sh @@ -40,22 +40,6 @@ _sh_main_log() { # sort -sh_source_find() { - local root="${1}" - local file="${2}" - set -- \ - "${root}" \ - -name "*.sh" \ - -type "f" - [ -n "${file}" ] && - set -- "${@}" \ - -not \ - -name "${file}" - find "${@}" \ - -printf "%P\n" | - sort -} - _sh_main_commands() { local file="${1}" grep "()" "${file}" | @@ -90,6 +74,22 @@ main_source_directory() { # public +sh_source_find() { + local root="${1}" + local file="${2}" + set -- \ + "${root}" \ + -name "*.sh" \ + -type "f" + [ -n "${file}" ] && + set -- "${@}" \ + -not \ + -name "${file}" + find "${@}" \ + -printf "%P\n" | + sort +} + sh_help() { sh_log \ "sh_… = shell functions" \