From f9b21f929116c9a8e0e34a83d38306b183166d95 Mon Sep 17 00:00:00 2001 From: Patrick McDermott Date: Tue, 23 Apr 2019 15:50:40 -0400 Subject: parse_control_error(): Move before use --- (limited to 'src/control.sh') diff --git a/src/control.sh b/src/control.sh index f4d1498..f9b1e08 100644 --- a/src/control.sh +++ b/src/control.sh @@ -18,6 +18,25 @@ # along with the ProteanOS Development Kit. If not, see # . +parse_control_error() +{ + local file="${1}" + local line_nr="${2}" + local msg_id="${3}" + shift 1 + local file_info= + + if [ ${line_nr} -eq 0 ]; then + file_info="$(printf '%20s:' "${file}")" + else + file_info="$(printf '%20s(l%d):' "${file}" "${line_nr}")" + fi + + warn "${file_info} $(get_msg "${msg_id}")" "${@}" + + return 0 +} + parse_control() { local field_cb="${2}" @@ -128,22 +147,3 @@ parse_control() return 0 } - -parse_control_error() -{ - local file="${1}" - local line_nr="${2}" - local msg_id="${3}" - shift 1 - local file_info= - - if [ ${line_nr} -eq 0 ]; then - file_info="$(printf '%20s:' "${file}")" - else - file_info="$(printf '%20s(l%d):' "${file}" "${line_nr}")" - fi - - warn "${file_info} $(get_msg "${msg_id}")" "${@}" - - return 0 -} -- cgit v0.9.1