diff options
author | Tom Ryder <tom@sanctum.geek.nz> | 2014-10-10 16:24:52 +1300 |
---|---|---|
committer | Tom Ryder <tom@sanctum.geek.nz> | 2014-10-10 16:24:52 +1300 |
commit | 614c3482eba4c4819b0847b6df13426dde4fbf6d (patch) | |
tree | 59a491d548a599f08af81d030339e8eb45f1f398 /bash/bashrc.d/grep.bash | |
parent | Extend list of Bash functions a bit (diff) | |
download | dotfiles-614c3482eba4c4819b0847b6df13426dde4fbf6d.tar.gz dotfiles-614c3482eba4c4819b0847b6df13426dde4fbf6d.zip |
Remove brace expansion for grep alias
Diffstat (limited to 'bash/bashrc.d/grep.bash')
-rw-r--r-- | bash/bashrc.d/grep.bash | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/bash/bashrc.d/grep.bash b/bash/bashrc.d/grep.bash index 6fffc20c..b2ff5daf 100644 --- a/bash/bashrc.d/grep.bash +++ b/bash/bashrc.d/grep.bash @@ -12,19 +12,23 @@ grepopts() { # If the --exclude option is available, exclude some VCS files if [[ $grephelp == *--exclude* ]] ; then - grepopts=("${grepopts[@]}" '--exclude=.git{,ignore,modules}') + for exclude_file in .gitignore .gitmodules ; do + grepopts=("${grepopts[@]}" --exclude="$exclude_file") + done fi # If the --exclude-dir option is available, exclude some VCS dirs if [[ $grephelp == *--exclude-dir* ]] ; then - grepopts=("${grepopts[@]}" '--exclude-dir=.{cvs,git,hg,svn}') + for exclude_dir in .cvs .git .hg .svn ; do + grepopts=("${grepopts[@]}" --exclude-dir="$exclude_dir") + done fi # If the --color option is available and we have a terminal that supports # at least eight colors, add --color=auto to the options local colors=$(tput colors) if [[ $grephelp == *--color* ]] && ((colors >= 8)) ; then - grepopts=("${grepopts[@]}" '--color=auto') + grepopts=("${grepopts[@]}" --color=auto) fi # Print the options as a single string, space-delimited |