From 18e4712fce9ad96907404e8bd6e12fcd4fac8fee Mon Sep 17 00:00:00 2001 From: Peter Marquardt Date: Thu, 26 Nov 2015 10:14:14 +0100 Subject: [PATCH 1/2] non colorized output per default. colors via BEE_COLOR='yes' 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-). --- src/bee-list.sh.in | 10 +++++++--- src/beelib.config.sh.in | 11 ++++++++--- 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/src/bee-list.sh.in b/src/bee-list.sh.in index e0db3b7..c093187 100644 --- a/src/bee-list.sh.in +++ b/src/bee-list.sh.in @@ -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" @@ -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 diff --git a/src/beelib.config.sh.in b/src/beelib.config.sh.in index 09ad99b..4860faa 100644 --- a/src/beelib.config.sh.in +++ b/src/beelib.config.sh.in @@ -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" @@ -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 } @@ -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 From b2e97de92ad8983003eebb59108dd56a7ab001bc Mon Sep 17 00:00:00 2001 From: Marius Tolzmann Date: Mon, 11 Jan 2016 23:26:41 +0100 Subject: [PATCH 2/2] bee: Minor color fixes --- src/bee-list.sh.in | 8 ++++---- src/beelib.config.sh.in | 8 ++++---- src/beesh.sh.in | 4 +--- 3 files changed, 9 insertions(+), 11 deletions(-) diff --git a/src/bee-list.sh.in b/src/bee-list.sh.in index c093187..9dd38d1 100644 --- a/src/bee-list.sh.in +++ b/src/bee-list.sh.in @@ -81,11 +81,11 @@ function usage() { } function config_init_colors() { - : ${BEE_COLOR:="no"} - if [ -t 1 ] ; then - BEE_COLOR='no' + : ${BEE_COLOR:="yes"} + if [ ! -t 1 ] ; then + BEE_COLOR="no" fi - if [ ${BEE_COLOR} != "no" ] ; then + if [ "${BEE_COLOR}" != "no" ] ; then COLOR_NORMAL="\\033[0;39m\\033[0;22m" COLOR_GREEN="\\033[0;32m" COLOR_YELLOW="\\033[0;33m" diff --git a/src/beelib.config.sh.in b/src/beelib.config.sh.in index 4860faa..9e22fba 100644 --- a/src/beelib.config.sh.in +++ b/src/beelib.config.sh.in @@ -26,11 +26,11 @@ : ${BEE_BINDIR:=@BINDIR@} function config_init_colors() { - : ${BEE_COLOR:="no"} - if [ -t 1 ] ; then - BEE_COLOR='no' + : ${BEE_COLOR:="yes"} + if [ ! -t 1 ] ; then + BEE_COLOR="no" fi - if [ ${BEE_COLOR} != "no" ] ; then + if [ "${BEE_COLOR}" != "no" ] ; then COLOR_NORMAL="\\033[0;39m\\033[0;22m" COLOR_GREEN="\\033[0;32m" COLOR_YELLOW="\\033[0;33m" diff --git a/src/beesh.sh.in b/src/beesh.sh.in index d33ee67..2cdb34c 100644 --- a/src/beesh.sh.in +++ b/src/beesh.sh.in @@ -914,15 +914,13 @@ while true ; do esac done -config_init_colors +config_init echo -e "${COLOR_CYAN}BEE v${BEE_VERSION} 2009-2012" echo -e " by Marius Tolzmann and Tobias Dreyer <{tolzmann,dreyer}@molgen.mpg.de>" echo -e " Max Planck Institute for Molecular Genetics Berlin Dahlem" echo -e "${COLOR_NORMAL}" -config_init - config_set_skiplist print_info " BEE_SKIPLIST ${BEE_SKIPLIST}"