Skip to content

Commit

Permalink
non colorized output per default. colors via BEE_COLOR='yes'
Browse files Browse the repository at this point in the history
bee color output is hard to read on terminals with light background.
beelib.config honored only [ -t 1 ] . To get colored output don't set BEE_COLOR='no' 8-).
  • Loading branch information
wwwutz committed Nov 26, 2015
1 parent f4f783f commit 18e4712
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 6 deletions.
10 changes: 7 additions & 3 deletions src/bee-list.sh.in
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,11 @@ function usage() {
}

function config_init_colors() {
: ${BEE_COLOR:="no"}
if [ -t 1 ] ; then
BEE_COLOR='no'
fi
if [ ${BEE_COLOR} != "no" ] ; then
COLOR_NORMAL="\\033[0;39m\\033[0;22m"
COLOR_GREEN="\\033[0;32m"
COLOR_YELLOW="\\033[0;33m"
Expand All @@ -106,9 +110,9 @@ function config_init_colors() {
COLOR_PURPLE=""
COLOR_BRACKET=""
COLOR_BRCONTENT=""
COLOR_INFO="**INFO** "
COLOR_ERROR="**ERROR** "
COLOR_WARN="**WARNING** "
COLOR_INFO=""
COLOR_ERROR=""
COLOR_WARN=""
COLOR_INSTALLABLE="installable "
COLOR_UPDATABLE=" updatable "
fi
Expand Down
11 changes: 8 additions & 3 deletions src/beelib.config.sh.in
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,11 @@
: ${BEE_BINDIR:=@BINDIR@}

function config_init_colors() {
: ${BEE_COLOR:="no"}
if [ -t 1 ] ; then
BEE_COLOR='no'
fi
if [ ${BEE_COLOR} != "no" ] ; then
COLOR_NORMAL="\\033[0;39m\\033[0;22m"
COLOR_GREEN="\\033[0;32m"
COLOR_YELLOW="\\033[0;33m"
Expand All @@ -49,9 +53,9 @@ function config_init_colors() {
COLOR_PURPLE=""
COLOR_BRACKET=""
COLOR_BRCONTENT=""
COLOR_INFO="**INFO** "
COLOR_ERROR="**ERROR** "
COLOR_WARN="**WARNING** "
COLOR_INFO=""
COLOR_ERROR=""
COLOR_WARN=""
fi
}

Expand Down Expand Up @@ -359,6 +363,7 @@ function config_init() {
config_load_local_config
config_load_user_config
config_load_system_config
config_init_colors
config_verify_builtin_config
config_verify_builtin_prefixes
config_handle_deprecated_config
Expand Down

0 comments on commit 18e4712

Please sign in to comment.