mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2024-11-25 07:10:08 +00:00
Merge pull request #3538 from TheLinuxKitten/grep-if-color
Test if --color=auto is a valid option for grep
This commit is contained in:
commit
ff6ca9b856
1 changed files with 5 additions and 1 deletions
|
@ -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}"
|
||||||
|
|
Loading…
Reference in a new issue