grep: keep grep-flag-available together

This commit is contained in:
Daniel Hahler 2015-01-07 15:11:30 +01:00
commit 330f02a245

View file

@ -2,15 +2,14 @@
VCS_FOLDERS="{.bzr,.cvs,.git,.hg,.svn}"
_setup_grep_alias() {
# Is grep argument $1 available?
grep-flag-available() {
echo | grep $1 "" >/dev/null 2>&1
}
local GREP_OPTIONS
# Color grep results.
GREP_OPTIONS=(--color=auto)
# Is grep argument $1 available?
grep-flag-available() {
echo | grep $1 "" >/dev/null 2>&1
}
if grep-flag-available --exclude-dir=.cvs; then
GREP_OPTIONS+=(--exclude-dir=$VCS_FOLDERS)
elif grep-flag-available --exclude=.cvs; then