diff options
author | Tom Ryder <tom@sanctum.geek.nz> | 2015-06-15 16:47:38 +1200 |
---|---|---|
committer | Tom Ryder <tom@sanctum.geek.nz> | 2015-06-15 16:47:38 +1200 |
commit | 31d2e82aaba4255808a3a2105516a9ea2205f7d8 (patch) | |
tree | b5ad22f44e6748ed965b111b5c3f27db7b58d84e /sh/profile.d | |
parent | Reset GREP_OPTIONS before building it (diff) | |
download | dotfiles-31d2e82aaba4255808a3a2105516a9ea2205f7d8.tar.gz dotfiles-31d2e82aaba4255808a3a2105516a9ea2205f7d8.zip |
Add --binary-files to default grep(1) options
Diffstat (limited to 'sh/profile.d')
-rw-r--r-- | sh/profile.d/grep.sh | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/sh/profile.d/grep.sh b/sh/profile.d/grep.sh index c722f9fb..2cc96545 100644 --- a/sh/profile.d/grep.sh +++ b/sh/profile.d/grep.sh @@ -9,10 +9,14 @@ case $grep_help in ;; esac -# Use GREP_OPTIONS to add some useful --exclude and --exclude-dir options to -# grep(1) calls if applicable +# Use GREP_OPTIONS to add some useful options to grep(1) calls if applicable GREP_OPTIONS= case $grep_help in + *--binary-files*) + GREP_OPTIONS=${GREP_OPTIONS:+$GREP_OPTIONS }'--binary-files=without-match' + ;; +esac +case $grep_help in *--exclude*) for exclude in .gitignore .gitmodules ; do GREP_OPTIONS=${GREP_OPTIONS:+$GREP_OPTIONS }'--exclude='$exclude |