commit:     755177bbfcf4c46ad1ac31ad9501a6c8725b1a68
Author:     Kerin Millar <kfm <AT> plushkava <DOT> net>
AuthorDate: Sun Jun  2 03:36:27 2024 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Tue Jun 11 06:11:59 2024 +0000
URL:        
https://gitweb.gentoo.org/proj/gentoo-functions.git/commit/?id=755177bb

Add the warn() function

This will be used internally by a forthcoming commit.

Signed-off-by: Kerin Millar <kfm <AT> plushkava.net>

 functions.sh | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/functions.sh b/functions.sh
index 9736747..a97dde7 100644
--- a/functions.sh
+++ b/functions.sh
@@ -473,6 +473,14 @@ vewend()
        fi
 }
 
+#
+# 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

Reply via email to