Commit 24243d8e authored by Vitaly Lipatov's avatar Vitaly Lipatov

check for egrep's --color

parent 8f9f7781
...@@ -130,9 +130,9 @@ __epm_search_make_grep() ...@@ -130,9 +130,9 @@ __epm_search_make_grep()
[ -n "$COLO" ] && COLO="$COLO|" [ -n "$COLO" ] && COLO="$COLO|"
COLO="$COLO$i" COLO="$COLO$i"
done done
# FIXME -n on MacOS?
if [ -n "$list" ] ; then if [ -n "$list" ] ; then
echo -n " | egrep -i --color -- \"($COLO)\"" echon " | egrep -i $EGREPCOLOR -- \"($COLO)\""
fi fi
} }
......
...@@ -45,6 +45,11 @@ check_tty() ...@@ -45,6 +45,11 @@ check_tty()
[ -n "$TERM" ] || TERM=dumb [ -n "$TERM" ] || TERM=dumb
export TERM export TERM
# egrep from busybox may not --color
if egrep --help | grep -q -- "--color" ; then
EGREPCOLOR="--color"
fi
which tput >/dev/null 2>/dev/null || return which tput >/dev/null 2>/dev/null || return
# FreeBSD does not support tput -S # FreeBSD does not support tput -S
echo | tput -S >/dev/null 2>/dev/null || return echo | tput -S >/dev/null 2>/dev/null || return
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment