| #!/bin/bash |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| function cli_getFunctions { |
| |
| |
| local LOCATION=$1 |
| |
| |
| local SUFFIX=$2 |
| |
| |
| |
| |
| if [[ $SUFFIX == '' ]];then |
| SUFFIX=$FUNCNAM |
| fi |
| |
| |
| |
| local PATTERN="^function[[:space:]]+${SUFFIX}[[:alnum:]_]*[[:space:]]+{$" |
| |
| |
| local FUNCFILES=$(cli_getFilesList ${LOCATION} --pattern="${SUFFIX}.*\.sh" --maxdepth="1") |
| |
| |
| |
| |
| |
| if [[ $FUNCFILES == '' ]];then |
| cli_printMessage "`gettext "No function file was found for this action."`" --as-error-line |
| fi |
| |
| |
| for FILE in $FUNCFILES;do |
| |
| |
| cli_checkFiles $FILE --execution |
| |
| |
| . $FILE |
| |
| |
| |
| export -f $(egrep "${PATTERN}" ${FILE} | cut -d' ' -f2) |
| |
| done |
| |
| } |