From 05a6c22d341fb7e3e70398408c5b9af1c629ddc4 Mon Sep 17 00:00:00 2001 From: Alain Reguera Delgado Date: May 30 2011 03:38:59 +0000 Subject: Update Backends/Texinfo/texinfo_getNode.sh. --- diff --git a/Scripts/Functions/Help/Backends/Texinfo/texinfo_getNode.sh b/Scripts/Functions/Help/Backends/Texinfo/texinfo_getNode.sh index 1aa406e..e7f107b 100755 --- a/Scripts/Functions/Help/Backends/Texinfo/texinfo_getNode.sh +++ b/Scripts/Functions/Help/Backends/Texinfo/texinfo_getNode.sh @@ -25,10 +25,20 @@ function texinfo_getNode { - local NODE=$(echo "$MANUAL_ENTRY" \ - | sed -r "s!^${MANUAL_BASEDIR}!!" \ - | sed -r 's!/! !g' | sed -r 's!^[[:space:]]+!!' \ - | sed -r "s/\.${FLAG_BACKEND}$//") + # Define documentation entry. + local MANUAL_ENTRY="$1" + + # Verify documentation entry. + if [[ $MANUAL_ENTRY == '' ]];then + cli_printMessage "`gettext "The first positional parameter cannot be empty."`" --as-error-line + fi + + # Define node from documentation entry. + local NODE=$(echo "$MANUAL_ENTRY" | sed -r \ + -e "s!^${MANUAL_BASEDIR}!!" \ + -e "s/(chapter-intro\.${FLAG_BACKEND}|\.${FLAG_BACKEND})$//" \ + -e 's!/! !g' \ + -e 's!^[[:space:]]+!!') echo "$NODE"