mirror of
https://github.com/moparisthebest/pacman
synced 2024-12-23 00:08:50 -05:00
f8ed8620d0
Added an `ask` message function that emulates pacman's appearance. Signed-off-by: William Giokas <1007380@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
33 lines
702 B
Bash
33 lines
702 B
Bash
plain() {
|
|
(( QUIET )) && return
|
|
local mesg=$1; shift
|
|
printf "${BOLD} ${mesg}${ALL_OFF}\n" "$@" >&1
|
|
}
|
|
|
|
msg() {
|
|
(( QUIET )) && return
|
|
local mesg=$1; shift
|
|
printf "${GREEN}==>${ALL_OFF}${BOLD} ${mesg}${ALL_OFF}\n" "$@" >&1
|
|
}
|
|
|
|
msg2() {
|
|
(( QUIET )) && return
|
|
local mesg=$1; shift
|
|
printf "${BLUE} ->${ALL_OFF}${BOLD} ${mesg}${ALL_OFF}\n" "$@" >&1
|
|
}
|
|
|
|
ask() {
|
|
local mesg=$1; shift
|
|
printf "${BLUE}::${ALL_OFF}${BOLD} ${mesg}${ALL_OFF}" "$@" >&1
|
|
}
|
|
|
|
warning() {
|
|
local mesg=$1; shift
|
|
printf "${YELLOW}==> $(gettext "WARNING:")${ALL_OFF}${BOLD} ${mesg}${ALL_OFF}\n" "$@" >&2
|
|
}
|
|
|
|
error() {
|
|
local mesg=$1; shift
|
|
printf "${RED}==> $(gettext "ERROR:")${ALL_OFF}${BOLD} ${mesg}${ALL_OFF}\n" "$@" >&2
|
|
}
|