diff --git a/Scripts/Bash/Functions/Commons/cli_exportFunctions.sh b/Scripts/Bash/Functions/Commons/cli_exportFunctions.sh index dd6b0fc..e52b430 100755 --- a/Scripts/Bash/Functions/Commons/cli_exportFunctions.sh +++ b/Scripts/Bash/Functions/Commons/cli_exportFunctions.sh @@ -26,14 +26,17 @@ function cli_exportFunctions { - # Verify the number of arguments passed to this function. - if [[ $# -lt 1 ]];then - cli_printMessage "${FUNCNAME}: `gettext "At least one argument must be passed."`" + # Retrieve export identifier for the function we want to export. + local EXPORTID="$1" + + # Verify the export identification existence. This argument must + # be passed as first argument and match a relative path format. + if [[ ! $EXPORTID ]] || [[ $EXPORTID == '' ]];then + cli_printMessage "`gettext "The export id must be passed as first argument."`" --as-error-line + elif [[ ! $EXPORTID =~ '^[A-Z][[:alpha:]]+(/[[:alpha:]]+)+$' ]];then + cli_printMessage "`gettext "The export id doesn't match its pattern."`" --as-error-line fi - # Retrive export identifier for the function we want to export. - local EXPORTID=$1 - # Define the source location where function files are placed in. local LOCATION=${CLI_BASEDIR}/Functions/$(dirname ${EXPORTID})