grep_functions
This commit is contained in:
parent
ff7f64e670
commit
ff077a039a
1 changed files with 7 additions and 7 deletions
14
sh/main.sh
14
sh/main.sh
|
@ -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" \
|
||||||
|
|
Loading…
Reference in a new issue