summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKerin Millar <kfm@plushkava.net>2024-06-04 04:23:10 +0100
committerKerin Millar <kfm@plushkava.net>2024-06-12 08:06:42 +0100
commit5e599c75905b04918ce7d7fdaa9dfd845c322d8e (patch)
tree34614417bd1730746fe772f6086271269912e0fa /functions.sh
parentAdd the GENFUN_API_LEVEL variable declaration (diff)
downloadgentoo-functions-5e599c75905b04918ce7d7fdaa9dfd845c322d8e.tar.gz
gentoo-functions-5e599c75905b04918ce7d7fdaa9dfd845c322d8e.tar.bz2
gentoo-functions-5e599c75905b04918ce7d7fdaa9dfd845c322d8e.zip
Promote _print_args() to the public function, quote_args()
Signed-off-by: Kerin Millar <kfm@plushkava.net>
Diffstat (limited to 'functions.sh')
-rw-r--r--functions.sh6
1 files changed, 3 insertions, 3 deletions
diff --git a/functions.sh b/functions.sh
index a0315f9..a9af6b6 100644
--- a/functions.sh
+++ b/functions.sh
@@ -95,7 +95,7 @@ ebegin()
#
edo()
{
- genfun_cmd=$(_print_args "$@")
+ genfun_cmd=$(quote_args "$@")
einfo "Executing: ${genfun_cmd}"
"$@" || die "Failed to execute command: ${genfun_cmd}"
}
@@ -844,7 +844,7 @@ _is_visible()
# of the ${*@Q} expansion in bash. The output shall be POSIX sh compatible as of
# Issue 8. This should probably be made to exist as a standalone awk script.
#
-_print_args()
+quote_args()
{
awk -v q=\' -f - -- "$@" <<-'EOF'
BEGIN {
@@ -963,7 +963,7 @@ _warn_for_args()
ident=$1
shift
[ "$#" -gt 1 ] && plural=s || plural=
- warn "${ident}: invalid argument${plural}: $(_print_args "$@")"
+ warn "${ident}: invalid argument${plural}: $(quote_args "$@")"
}
# All function declarations end here! Initialisation code only from hereon.