Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
adam.huang
Oh My Zsh
Commits
ff6ca9b8
Commit
ff6ca9b8
authored
Feb 22, 2015
by
Robby Russell
Browse files
Merge pull request #3538 from TheLinuxKitten/grep-if-color
Test if --color=auto is a valid option for grep
parents
e2fd99a4
f2130fa1
Changes
1
Hide whitespace changes
Inline
Side-by-side
lib/grep.zsh
View file @
ff6ca9b8
...
@@ -3,8 +3,12 @@ grep-flag-available() {
...
@@ -3,8 +3,12 @@ grep-flag-available() {
echo
|
grep
$1
""
>
/dev/null 2>&1
echo
|
grep
$1
""
>
/dev/null 2>&1
}
}
GREP_OPTIONS
=
""
# color grep results
# color grep results
GREP_OPTIONS
=
"--color=auto"
if
grep-flag-available
--color
=
auto
;
then
GREP_OPTIONS+
=
" --color=auto"
fi
# ignore VCS folders (if the necessary grep flags are available)
# ignore VCS folders (if the necessary grep flags are available)
VCS_FOLDERS
=
"{.bzr,.cvs,.git,.hg,.svn}"
VCS_FOLDERS
=
"{.bzr,.cvs,.git,.hg,.svn}"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment