From 3561c872ca0980c76442fcbf3985cc92a8f572f7 Mon Sep 17 00:00:00 2001 From: Eli Schwartz Date: Thu, 28 Jun 2018 13:19:42 -0400 Subject: 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 Signed-off-by: Allan McRae --- scripts/libmakepkg/util/message.sh.in | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'scripts/libmakepkg/util/message.sh.in') 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 -- cgit v1.2.3-54-g00ecf