grep: use array for options

This commit is contained in:
Daniel Hahler 2015-01-07 14:40:28 +01:00
commit 4cfcf09cef

View file

@ -7,13 +7,14 @@ _setup_grep_alias() {
echo | grep $1 "" >/dev/null 2>&1
}
local GREP_OPTIONS
# Color grep results.
local GREP_OPTIONS="--color=auto"
GREP_OPTIONS=(--color=auto)
if grep-flag-available --exclude-dir=.cvs; then
GREP_OPTIONS+=" --exclude-dir=$VCS_FOLDERS"
GREP_OPTIONS+=(--exclude-dir=$VCS_FOLDERS)
elif grep-flag-available --exclude=.cvs; then
GREP_OPTIONS+=" --exclude=$VCS_FOLDERS"
GREP_OPTIONS+=(--exclude=$VCS_FOLDERS)
fi
# Re-define alias.