Skip to content

Instantly share code, notes, and snippets.

@pnkfelix
Created April 8, 2013 22:37
Show Gist options
  • Save pnkfelix/5341167 to your computer and use it in GitHub Desktop.
Save pnkfelix/5341167 to your computer and use it in GitHub Desktop.
#!/bin/bash
# Exuberant ctags, installed via homebrew on OS X
CTAGS=/usr/local/bin/ctags
#CTAGS_ARGS="-e -a --extra=+qf"
CTAGS_ARGS="-e -a --extra=+f"
# May want to investigate options like --c++-kinds=... (see --list-kinds=c++)
if hg root >& /dev/null ; then
ROOT=$(hg root)
else
ROOT=$(git rev-parse --show-toplevel)
fi
echo "Indexing from $ROOT"
cd $ROOT
rm -f TAGS
find js/src \( -name '*.cpp' -o -name '*.h' -o -name '*.hpp' \) -exec $CTAGS $CTAGS_ARGS {} \;
find js/public \( -name '*.cpp' -o -name '*.h' -o -name '*.hpp' \) -exec $CTAGS $CTAGS_ARGS {} \;
find js/ductwork \( -name '*.cpp' -o -name '*.h' -o -name '*.hpp' \) -exec $CTAGS $CTAGS_ARGS {} \;
find nsprpub \( -name '*.cpp' -o -name '*.h' -o -name '*.hpp' \) -exec $CTAGS $CTAGS_ARGS {} \;
find mfbt \( -name '*.cpp' -o -name '*.h' -o -name '*.hpp' \) -exec $CTAGS $CTAGS_ARGS {} \;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment