Commit f2130fa1 authored by The Linux Kitten's avatar The Linux Kitten
Browse files

Test if --color=auto is a valid option for grep

parent 550ccca9
...@@ -3,8 +3,12 @@ grep-flag-available() { ...@@ -3,8 +3,12 @@ grep-flag-available() {
echo | grep $1 "" >/dev/null 2>&1 echo | grep $1 "" >/dev/null 2>&1
} }
GREP_OPTIONS=""
# color grep results # color grep results
GREP_OPTIONS="--color=auto" if grep-flag-available --color=auto; then
GREP_OPTIONS+=" --color=auto"
fi
# ignore VCS folders (if the necessary grep flags are available) # ignore VCS folders (if the necessary grep flags are available)
VCS_FOLDERS="{.bzr,.cvs,.git,.hg,.svn}" VCS_FOLDERS="{.bzr,.cvs,.git,.hg,.svn}"
......
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