aboutsummaryrefslogtreecommitdiff
path: root/bash/bashrc.d/grep.bash
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2014-10-10 16:25:47 +1300
committerTom Ryder <tom@sanctum.geek.nz>2014-10-10 16:25:47 +1300
commite1401360121785b7dd7b5b5d7b7ef5b337e5bb39 (patch)
treeed7e1e9c7020e17d7acbe5a6bb173d6f6d94d854 /bash/bashrc.d/grep.bash
parentRemove brace expansion for grep alias (diff)
downloaddotfiles-e1401360121785b7dd7b5b5d7b7ef5b337e5bb39.tar.gz
dotfiles-e1401360121785b7dd7b5b5d7b7ef5b337e5bb39.zip
Move array decs inline, remove quotes
Diffstat (limited to 'bash/bashrc.d/grep.bash')
-rw-r--r--bash/bashrc.d/grep.bash9
1 files changed, 3 insertions, 6 deletions
diff --git a/bash/bashrc.d/grep.bash b/bash/bashrc.d/grep.bash
index b2ff5daf..de225347 100644
--- a/bash/bashrc.d/grep.bash
+++ b/bash/bashrc.d/grep.bash
@@ -1,15 +1,12 @@
# Return appropriate options for grep
grepopts() {
+ # Start with ignoring binary files
+ local -a grepopts=(-I)
+
# Snarf the output of `grep --help` into a variable
local grephelp=$(grep --help 2>/dev/null)
- # Start collecting available options
- local -a grepopts
-
- # Add option to ignore binary files
- grepopts=("${grepopts[@]}" '-I')
-
# If the --exclude option is available, exclude some VCS files
if [[ $grephelp == *--exclude* ]] ; then
for exclude_file in .gitignore .gitmodules ; do