summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--functions.sh8
1 files changed, 8 insertions, 0 deletions
diff --git a/functions.sh b/functions.sh
index 9736747..a97dde7 100644
--- a/functions.sh
+++ b/functions.sh
@@ -474,6 +474,14 @@ vewend()
}
#
+# Prints a diagnostic message prefixed with the basename of the running script.
+#
+warn()
+{
+ printf '%s: %s\n' "${0##*/}" "$*" >&2
+}
+
+#
# Determines whether the first parameter is truthy. The values taken to be true
# are "yes", "true", "on" and "1", whereas their opposites are taken to be
# false. The empty string is also taken to be false. All pattern matching is