# HG changeset patch # User Franz Glasner # Date 1725029063 -7200 # Node ID 8af33277a2dd92e0dd252d96d03e56d86d9e1d8a # Parent fb362bcab7226eddc8ed2f697b703a9bc0337ede Also implement "err()" in as common shell subroutine diff -r fb362bcab722 -r 8af33277a2dd share/local-bsdtools/common.subr --- a/share/local-bsdtools/common.subr Fri Aug 30 16:42:04 2024 +0200 +++ b/share/local-bsdtools/common.subr Fri Aug 30 16:44:23 2024 +0200 @@ -38,6 +38,23 @@ #: +#: Display an error message to stderr +#: +#: Args: +#: $*: The message to print to +#: +#: Returns: +#: 0 +#: +#: The name of the script is prepended to the error message always. +#: +err() { + printf "%s: ERROR: %s\\n" "$0" "$*" + return 0 +} + + +#: #: Display a warning to stderr #: #: Args: