# HG changeset patch # User Christophe Lincoln # Date 1337259231 -7200 # Node ID 1592841294174137b0d4f451770472c69343247d # Parent 207fe5fca40a275c72004193112478a668cf7d70 Colorize DEBUG and let use --decolor=NB diff -r 207fe5fca40a -r 159284129417 rootfs/lib/libtaz.sh --- a/rootfs/lib/libtaz.sh Thu May 17 09:10:39 2012 +0200 +++ b/rootfs/lib/libtaz.sh Thu May 17 14:53:51 2012 +0200 @@ -18,8 +18,9 @@ # Internal variables. okmsg="$(gettext "Done")" ermsg="$(gettext "Failed")" -okcolor=32 -ercolor=31 +: ${okcolor=32} +: ${ercolor=31} +: ${decolor=36} # Parse cmdline options and store values in a variable. for opt in "$@" @@ -96,7 +97,7 @@ unset color } -# Indent text $1 spaces +# Indent text $1 spaces. indent() { local in="$1" shift @@ -111,8 +112,9 @@ fi } +# Display debug info when --debug is used. debug() { - [ "$debug" ] && echo "DEBUG: $1" + [ "$debug" ] && echo "$(colorize "DEBUG:" $decolor) $1" } # Gettextize yes/no.