Delete grep variables after we use them

This commit is contained in:
Marc Cornellà 2014-12-13 19:36:57 +01:00
commit 15d529157f

View file

@ -6,7 +6,7 @@
GREP_OPTIONS="--color=auto"
# avoid VCS folders (if the necessary grep flags are available)
local VCS_folders="{.bzr,.cvs,.git,.hg,.svn}"
VCS_folders="{.bzr,.cvs,.git,.hg,.svn}"
grep-flag-available() {
echo | command grep $1 "" >/dev/null 2>&1
@ -16,7 +16,11 @@ if grep-flag-available --exclude-dir=.cvs; then
elif grep-flag-available --exclude=.cvs; then
GREP_OPTIONS+=" --exclude=$VCS_folders"
fi
unfunction grep-flag-available
export GREP_OPTIONS="$GREP_OPTIONS"
export GREP_COLOR='1;32'
# cleanup
unset VCS_folders
unfunction grep-flag-available