From: Colin Clark Date: Thu, 1 Apr 2021 10:00:53 +0000 (+0100) Subject: Ouput exit status from doxygen-help X-Git-Tag: v1.7~141 X-Git-Url: http://geeqie.org/cgi-bin/gitweb.cgi?p=geeqie.git;a=commitdiff_plain;h=3530cdd6b361a7542648dc9ac1bece4e3b405f64 Ouput exit status from doxygen-help Exit status 0 if a match found in the .tag file, otherwise exit status 1. --- diff --git a/scripts/doxygen-help.sh b/scripts/doxygen-help.sh index 85db88b9..191b5bac 100755 --- a/scripts/doxygen-help.sh +++ b/scripts/doxygen-help.sh @@ -58,21 +58,16 @@ then echo "Environment variable PROJECT not set" zenity --title="Geeqie" --width=200 --warning --text="Environment variable PROJECT not set" else - awk -v search_param="$1" -v docdir="$DOCDIR" ' + url_found=$(awk -v search_param="$1" -v docdir="$DOCDIR" ' { - if ($1 == "_"search_param"") + if ($1 == "_"search_param"") { - found=0 - while (found == 0) - { - getline - n=split($1, anchorfile, /[<>]/) - if (anchorfile[2] == "anchorfile") - { - found=1 - } - } - data_result="file://"docdir"/html/" anchorfile[3] + getline + n=split($1, anchorfile, /[<>]/) + + getline + n=split($1, anchor, /[<>]/) + struct_result="file://"docdir"/html/" anchorfile[3] "#" anchor[3] } else { @@ -88,14 +83,22 @@ else } } END { - if (data_result != "") + if (struct_result != "") { - print data_result + print struct_result } else if (function_result != "") { print function_result } } - ' $DOCDIR/$PROJECT.tag | while read -r file; do xdg-open "$file"; done + ' $DOCDIR/$PROJECT.tag) + + if [[ -z $url_found ]] + then + exit 1 + else + xdg-open "$url_found" + exit 0 + fi fi