diff options
author | 2024-06-02 04:36:27 +0100 | |
---|---|---|
committer | 2024-06-11 07:11:59 +0100 | |
commit | 755177bbfcf4c46ad1ac31ad9501a6c8725b1a68 (patch) | |
tree | e417459c9aec6da3fe2badd7f31012e13fffe8a9 | |
parent | Add the has_openrc() and has_systemd() functions (diff) | |
download | gentoo-functions-755177bbfcf4c46ad1ac31ad9501a6c8725b1a68.tar.gz gentoo-functions-755177bbfcf4c46ad1ac31ad9501a6c8725b1a68.tar.bz2 gentoo-functions-755177bbfcf4c46ad1ac31ad9501a6c8725b1a68.zip |
Add the warn() function
This will be used internally by a forthcoming commit.
Signed-off-by: Kerin Millar <kfm@plushkava.net>
-rw-r--r-- | functions.sh | 8 |
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 |