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()
[ -n "$COLO" ] && COLO="$COLO|"
COLO="$COLO$i"
done
# FIXME -n on MacOS?
if [ -n "$list" ] ; then
echo -n " | egrep -i --color -- \"($COLO)\""
echon " | egrep -i $EGREPCOLOR -- \"($COLO)\""
fi
}
......
......@@ -45,6 +45,11 @@ check_tty()
[ -n "$TERM" ] || TERM=dumb
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
# FreeBSD does not support tput -S
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