libs: made error message clearer and more consistent
This commit is contained in:
@@ -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 $?
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user