You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

20 lines
478 B
Bash

verbose () {
echo $2 "${color_green}$1${color_normal}"
}
error () {
echo $2 "${color_red}$1${color_normal}"
}
warning () {
echo $2 "${color_yellow}$1${color_normal}"
}
# check for color support
if test -t 1; then
# see if it supports colors...
ncolors=$(tput colors)
if test -n "$ncolors" && test $ncolors -ge 8; then
color_normal="$(tput sgr0)"
color_red="$(tput setaf 1)"
color_green="$(tput setaf 2)"
color_yellow="$(tput setaf 3)"
fi
fi