aboutsummaryrefslogtreecommitdiff
path: root/bash/bashrc.d/grep.bash
diff options
context:
space:
mode:
Diffstat (limited to 'bash/bashrc.d/grep.bash')
-rw-r--r--bash/bashrc.d/grep.bash8
1 files changed, 4 insertions, 4 deletions
diff --git a/bash/bashrc.d/grep.bash b/bash/bashrc.d/grep.bash
index 656e3c77..4bd2ed5e 100644
--- a/bash/bashrc.d/grep.bash
+++ b/bash/bashrc.d/grep.bash
@@ -11,24 +11,24 @@ __grepopts() {
grepopts[${#grepopts[@]}]='-I'
# If the --exclude option is available, exclude some VCS files
- if [[ "$grephelp" == *--exclude* ]]; then
+ if [[ $grephelp == *--exclude* ]]; then
grepopts[${#grepopts[@]}]='--exclude=.git{,ignore,modules}'
fi
# If the --exclude option is available, exclude some VCS dirs
- if [[ "$grephelp" == *--exclude-dir* ]]; then
+ if [[ $grephelp == *--exclude-dir* ]]; then
grepopts[${#grepopts[@]}]='--exclude-dir=.{cvs,git,hg,svn}'
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 -i colors="$(tput colors)"
- if [[ "$grephelp" == *--color* ]] && ((colors >= 8)); then
+ if [[ $grephelp == *--color* ]] && ((colors >= 8)); then
grepopts[${#grepopts[@]}]='--color=auto'
fi
# Print the options as a single string, space-delimited
- printf -- "${grepopts[*]}"
+ printf '%s' "${grepopts[*]}"
}
# Alias grep with those options