libs: made error message clearer and more consistent

This commit is contained in:
levasseur
2021-12-13 18:49:03 +01:00
parent bbd35ee3c6
commit d9af921417
6 changed files with 17 additions and 12 deletions

View File

@@ -21,6 +21,11 @@ export -f stdtime
# ------------------------------------------------------------------------------
# Check if a function exists, return 0 if so
function_exists() {
if [[ $# -ne 1 ]]; then
prnt E "function_exists(): A function name is required!"
die 11 --force
fi
LC_ALL=C type -t $1 | grep function
return $?
}