From: Hugo Villeneuve Date: Fri, 6 Oct 2023 21:51:42 +0000 (-0400) Subject: Simplify get_label() and get_frame_id() X-Git-Url: http://gitweb.hugovil.com/?a=commitdiff_plain;h=21f1fd0604f2a77d4cf5177322f65493c8a60f1f;p=fgen.git Simplify get_label() and get_frame_id() Remove return values. --- diff --git a/fgen.sh b/fgen.sh index 45b3001..6e66b49 100755 --- a/fgen.sh +++ b/fgen.sh @@ -50,27 +50,16 @@ function get_pos() # Arg1: line function get_label() { - frame=$(echo "${1}" | ${SED} "s/.*label:\(.*\),geometry.*/\1/g") - - if [ x"${frame}" = x"" ]; then - echo "" - return 1 - else - echo "${frame}" - return 0 - fi + local token + token=$(echo "${1}" | ${SED} "s/.*label:\(.*\),geometry.*/\1/g") + echo "${token}" } # Arg1: line function get_frame_id() { frame=$(echo "${1}" | grep -e "label:[0-9]\+," | ${SED} "s/.*label:\([0-9]\+\),.*/\1/g") - - if [ x"${frame}" = x"" ]; then - echo "" - else - echo "${frame}" - fi + echo "${frame}" } # Arg1: line