create_tags is added

This commit is contained in:
Vahagn Khachatryan
2017-06-22 14:41:22 -04:00
parent 3a98152e27
commit 0a7e572358
2 changed files with 56 additions and 4 deletions

View File

@@ -282,6 +282,39 @@ function cgrep() {
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='.ctags_dir'
if [ -f $PWD/$CTAGS_DIR ]; then
CTAGS_ROOT="$PWD"
elif [ -f $PWD/../$CTAGS_DIR ]; then
CTAGS_ROOT="$PWD/.."
elif [ -f $PWD/../../$CTAGS_DIR]; then
CTAGS_ROOT="$PWD/../.."
else
CTAGS_ROOT="$PWD"
fi
if [ -f $CTAGS_ROOT/$CTAGS_DIR ]; then
CTAGS_SRC="-L $CTAGS_ROOT/$CTAGS_DIR"
else
CTAGS_SRC='$@'
fi
cd $CTAGS_ROOT
$CTAGS $CTAGS_OPT $CTAGS_SRC
cd -
}
# Add an "alert" alias for long running commands. Use like so:
# sleep 10; alert