63 lines
1.3 KiB
Bash
Executable File
63 lines
1.3 KiB
Bash
Executable File
#!/bin/bash
|
|
|
|
#
|
|
# colored GCC warnings and errors
|
|
#
|
|
export GCC_COLORS='error=01;31:warning=01;35:note=01;36:caret=01;32:locus=01:quote=01'
|
|
|
|
function cgrep() {
|
|
if [[ $# -eq 0 ]]
|
|
then
|
|
echo "Usage: cgrep <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
|
|
}
|
|
|
|
|
|
function create_tags() {
|
|
#Bloomberg
|
|
if [ -e /opt/swt/bin/ctags ]; then
|
|
CTAGS=/opt/swt/bin/ctags
|
|
else
|
|
CTAGS=ctags
|
|
fi
|
|
CTAGS_OPT='--recurse=yes '
|
|
CTAGS_OPT+='--verbose '
|
|
CTAGS_OPT+='--totals=yes '
|
|
CTAGS_OPT+='--tag-relative=yes '
|
|
|
|
CTAGS_DIR_CFG='.ctags_dir'
|
|
CTAGS_ROOT="$PWD"
|
|
if [ ! -f $PWD/$CTAGS_DIR_CFG ]; then
|
|
GIT_ROOT=$(git top pwd)
|
|
if [ -f $GIT_ROOT/$CTAGS_DIR_CFG ]; then
|
|
CTAGS_ROOT="$GIT_ROOT"
|
|
fi
|
|
fi
|
|
|
|
if [ -f $CTAGS_ROOT/$CTAGS_DIR_CFG ]; then
|
|
CTAGS_SRC="-L $CTAGS_ROOT/$CTAGS_DIR"
|
|
else
|
|
CTAGS_SRC="$@"
|
|
fi
|
|
|
|
cd $CTAGS_ROOT
|
|
$CTAGS $CTAGS_OPT $CTAGS_SRC
|
|
cd -
|
|
}
|
|
|