From 330f02a245cfe879632341071084a5f12483b37f Mon Sep 17 00:00:00 2001 From: Daniel Hahler Date: Wed, 7 Jan 2015 15:11:30 +0100 Subject: [PATCH] grep: keep grep-flag-available together --- lib/grep.zsh | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/lib/grep.zsh b/lib/grep.zsh index c7e8bbffc..af78c3d7d 100644 --- a/lib/grep.zsh +++ b/lib/grep.zsh @@ -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