05a6c2 Update Backends/Texinfo/texinfo_getNode.sh.

Authored and Committed by areguera 13 years ago
    Update Backends/Texinfo/texinfo_getNode.sh.
    
        
Scripts/Functions/Help/Backends/Texinfo/texinfo_getNode.sh CHANGED
@@ -25,10 +25,20 @@
25
25
26
26
function texinfo_getNode {
27
27
28
- local NODE=$(echo "$MANUAL_ENTRY" \
29
- | sed -r "s!^${MANUAL_BASEDIR}!!" \
30
- | sed -r 's!/! !g' | sed -r 's!^[[:space:]]+!!' \
31
- | sed -r "s/\.${FLAG_BACKEND}$//")
28
+ # Define documentation entry.
29
+ local MANUAL_ENTRY="$1"
30
+
31
+ # Verify documentation entry.
32
+ if [[ $MANUAL_ENTRY == '' ]];then
33
+ cli_printMessage "`gettext "The first positional parameter cannot be empty."`" --as-error-line
34
+ fi
35
+
36
+ # Define node from documentation entry.
37
+ local NODE=$(echo "$MANUAL_ENTRY" | sed -r \
38
+ -e "s!^${MANUAL_BASEDIR}!!" \
39
+ -e "s/(chapter-intro\.${FLAG_BACKEND}|\.${FLAG_BACKEND})$//" \
40
+ -e 's!/! !g' \
41
+ -e 's!^[[:space:]]+!!')
32
42
33
43
echo "$NODE"
34
44