summaryrefslogtreecommitdiffstats
path: root/lib/output.sh
diff options
context:
space:
mode:
authorPatrick McDermott <patrick.mcdermott@libiquity.com>2019-03-13 02:51:56 (EDT)
committer Patrick McDermott <patrick.mcdermott@libiquity.com>2019-03-13 02:56:19 (EDT)
commit9033d4b6b9b85ab3e502b376daf66ae566c026b6 (patch)
tree5933fa9a313caff0ec5a0aa38e4087cba777c6d8 /lib/output.sh
parente153a4a392e2f6e616b2c94b77eb683eff9e644a (diff)
libopkbuild: Abort on invalid function arguments
Shift arguments and abort instead of returning 125. Incorrect numbers of function arguments suggest application/library incompatibilities or serious errors by the application developer. Either way, the application developer should be made immediately aware of this (and not allowed to simply not check return values), and continuing to run and handle any further API calls may be unsafe.
Diffstat (limited to 'lib/output.sh')
-rw-r--r--lib/output.sh12
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/output.sh b/lib/output.sh
index 4fe45f1..9d08759 100644
--- a/lib/output.sh
+++ b/lib/output.sh
@@ -32,7 +32,7 @@
ob_error()
{
local format="${1}"
- shift 1
+ shift 1 || _ob_abort
printf "$(_get_msg 'output_error_format')\n" "${0##*/}" "${@}" >&2
@@ -52,7 +52,7 @@ ob_error()
ob_warn()
{
local format="${1}"
- shift 1
+ shift 1 || _ob_abort
printf "$(_get_msg 'output_warning_format')\n" "${0##*/}" "${@}" >&2
@@ -72,7 +72,7 @@ ob_warn()
ob_info()
{
local format="${1}"
- shift 1
+ shift 1 || _ob_abort
printf "$(_get_msg 'output_info_format')\n" "${0##*/}" "${@}" >&2
@@ -82,7 +82,7 @@ ob_info()
_ob_error_msg()
{
local msgid="${1}"
- shift 1
+ shift 1 || _ob_abort
ob_error "$(_ob_get_msg "${msgid}")" "${@}"
@@ -92,7 +92,7 @@ _ob_error_msg()
_ob_warn_msg()
{
local msgid="${1}"
- shift 1
+ shift 1 || _ob_abort
ob_warn "$(_ob_get_msg "${msgid}")" "${@}"
@@ -102,7 +102,7 @@ _ob_warn_msg()
_ob_info_msg()
{
local msgid="${1}"
- shift 1
+ shift 1 || _ob_abort
ob_info "$(_ob_get_msg "${msgid}")" "${@}"