summaryrefslogtreecommitdiffstats
path: root/scripts/libmakepkg/util
diff options
context:
space:
mode:
authorEli Schwartz <eschwartz@archlinux.org>2018-06-28 19:19:42 +0200
committerAllan McRae <allan@archlinux.org>2018-10-21 12:20:45 +0200
commit3561c872ca0980c76442fcbf3985cc92a8f572f7 (patch)
treeac09f53647f997b1992c62604e59b78ab65452ef /scripts/libmakepkg/util
parent882e707e40bbade0111cf3bdedbdac4d4b70453b (diff)
downloadpacman-3561c872ca0980c76442fcbf3985cc92a8f572f7.tar.gz
pacman-3561c872ca0980c76442fcbf3985cc92a8f572f7.tar.xz
message.sh: add modifications from output_format.sh
In the spirit of making libmakepkg more useful as a library, and, critically, *using* that library for additional pacman scripts, we should include all of output_format.sh and term_colors.sh directly in libmakepkg and hopefully stop having to embed additional copies in e.g. repo-add via m4 macros. Signed-off-by: Eli Schwartz <eschwartz@archlinux.org> Signed-off-by: Allan McRae <allan@archlinux.org>
Diffstat (limited to 'scripts/libmakepkg/util')
-rw-r--r--scripts/libmakepkg/util/message.sh.in8
1 files changed, 8 insertions, 0 deletions
diff --git a/scripts/libmakepkg/util/message.sh.in b/scripts/libmakepkg/util/message.sh.in
index 36790c26..097da2b2 100644
--- a/scripts/libmakepkg/util/message.sh.in
+++ b/scripts/libmakepkg/util/message.sh.in
@@ -44,20 +44,28 @@ colorize() {
}
plain() {
+ (( QUIET )) && return
local mesg=$1; shift
printf "${BOLD} ${mesg}${ALL_OFF}\n" "$@"
}
msg() {
+ (( QUIET )) && return
local mesg=$1; shift
printf "${GREEN}==>${ALL_OFF}${BOLD} ${mesg}${ALL_OFF}\n" "$@"
}
msg2() {
+ (( QUIET )) && return
local mesg=$1; shift
printf "${BLUE} ->${ALL_OFF}${BOLD} ${mesg}${ALL_OFF}\n" "$@"
}
+ask() {
+ local mesg=$1; shift
+ printf "${BLUE}::${ALL_OFF}${BOLD} ${mesg}${ALL_OFF}" "$@"
+}
+
warning() {
local mesg=$1; shift
printf "${YELLOW}==> $(gettext "WARNING:")${ALL_OFF}${BOLD} ${mesg}${ALL_OFF}\n" "$@" >&2