Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
oh-my-zsh
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
github
oh-my-zsh
Commits
f2130fa1
Commit
f2130fa1
authored
Feb 02, 2015
by
The Linux Kitten
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Test if --color=auto is a valid option for grep
parent
550ccca9
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
1 deletion
+5
-1
grep.zsh
lib/grep.zsh
+5
-1
No files found.
lib/grep.zsh
View file @
f2130fa1
...
@@ -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