diff options
author | Patrick McDermott <patrick.mcdermott@libiquity.com> | 2019-04-23 15:50:40 (EDT) |
---|---|---|
committer | Patrick McDermott <patrick.mcdermott@libiquity.com> | 2019-04-23 15:50:40 (EDT) |
commit | f9b21f929116c9a8e0e34a83d38306b183166d95 (patch) | |
tree | bc383db81411b46572f3dfae5da9155290772f33 /src | |
parent | f504cf65a1b2fd74614eea99666528845cec773a (diff) |
parse_control_error(): Move before use
Diffstat (limited to 'src')
-rw-r--r-- | src/control.sh | 38 |
1 files changed, 19 insertions, 19 deletions
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 # <http://www.gnu.org/licenses/>. +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 -} |