mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-03-13 03:12:21 +01:00
grep: use array for options
This commit is contained in:
parent
fec736f7f6
commit
4cfcf09cef
1 changed files with 4 additions and 3 deletions
|
|
@ -7,13 +7,14 @@ _setup_grep_alias() {
|
||||||
echo | grep $1 "" >/dev/null 2>&1
|
echo | grep $1 "" >/dev/null 2>&1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
local GREP_OPTIONS
|
||||||
# Color grep results.
|
# Color grep results.
|
||||||
local GREP_OPTIONS="--color=auto"
|
GREP_OPTIONS=(--color=auto)
|
||||||
|
|
||||||
if grep-flag-available --exclude-dir=.cvs; then
|
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
|
elif grep-flag-available --exclude=.cvs; then
|
||||||
GREP_OPTIONS+=" --exclude=$VCS_FOLDERS"
|
GREP_OPTIONS+=(--exclude=$VCS_FOLDERS)
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Re-define alias.
|
# Re-define alias.
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue