1
0
mirror of https://github.com/moparisthebest/pacman synced 2024-12-23 16:28:50 -05:00
pacman/scripts/library/output_format.sh
Allan McRae 4272b37d3d scripts: refactor output formatting functions
Move the common output formatting functions into a separate
library file and import that into each script.  makepkg is
excluded due to its additional color formatting.

Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-06-15 09:18:05 -05:00

21 lines
358 B
Bash

msg() {
(( QUIET )) && return
local mesg=$1; shift
printf "==> ${mesg}\n" "$@" >&1
}
msg2() {
(( QUIET )) && return
local mesg=$1; shift
printf " -> ${mesg}\n" "$@" >&1
}
warning() {
local mesg=$1; shift
printf "==> $(gettext "WARNING:") ${mesg}\n" "$@" >&2
}
error() {
local mesg=$1; shift
printf "==> $(gettext "ERROR:") ${mesg}\n" "$@" >&2
}