diff --git a/sh/main.sh b/sh/main.sh index 61637fb..7da2446 100644 --- a/sh/main.sh +++ b/sh/main.sh @@ -24,6 +24,21 @@ sh_source_check() { rm "${file}" } +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" +} + _sh_main_commands() { local file="${1}" grep "()" "${file}" |