cgrep
This commit is contained in:
@@ -259,7 +259,28 @@ else
|
|||||||
alias fgrep='fgrep --color=auto'
|
alias fgrep='fgrep --color=auto'
|
||||||
alias egrep='egrep --color=auto'
|
alias egrep='egrep --color=auto'
|
||||||
fi
|
fi
|
||||||
alias cgrep="grep --include \*.cpp --include \*.h --include \*.c"
|
|
||||||
|
function cgrep() {
|
||||||
|
if [[ $# -eq 0 ]]
|
||||||
|
then
|
||||||
|
echo "Usage: codegrep <pattern> "
|
||||||
|
else
|
||||||
|
grep -nR --colour \
|
||||||
|
--include=\*.cpp \
|
||||||
|
--include=\*.c \
|
||||||
|
--include=\*.hpp \
|
||||||
|
--include=\*.h \
|
||||||
|
--include=\*.inc \
|
||||||
|
--include=\*.php \
|
||||||
|
--include=\*.py \
|
||||||
|
--include=\*.sh \
|
||||||
|
--exclude-dir=.git \
|
||||||
|
--exclude-dir=.svn \
|
||||||
|
--exclude-dir=llcalc* \
|
||||||
|
--exclude-dir=00* \
|
||||||
|
"$1" .
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
# Add an "alert" alias for long running commands. Use like so:
|
# Add an "alert" alias for long running commands. Use like so:
|
||||||
|
|||||||
Reference in New Issue
Block a user