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
f2130fa1
Commit
f2130fa1
authored
Feb 02, 2015
by
The Linux Kitten
Browse files
Test if --color=auto is a valid option for grep
parent
550ccca9
Changes
1
Hide whitespace changes
Inline
Side-by-side
lib/grep.zsh
View file @
f2130fa1
...
...
@@ -3,8 +3,12 @@ grep-flag-available() {
echo
|
grep
$1
""
>
/dev/null 2>&1
}
GREP_OPTIONS
=
""
# 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)
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