Skip to content

Instantly share code, notes, and snippets.

@nikomatsakis
Created August 31, 2017 16:17
Show Gist options
  • Save nikomatsakis/c903d490fc94d66aa0acd5375778d554 to your computer and use it in GitHub Desktop.
Save nikomatsakis/c903d490fc94d66aa0acd5375778d554 to your computer and use it in GitHub Desktop.
#!/bin/bash
if [[ "$1" == "" ]]; then
echo Usage: rust-ctags dirs...
exit 1
fi
if [ ! -f "$DOTFILES/etc/ctags.rust" ]; then
echo ctags.rust definition not found, is '$DOTFILES' set?
echo Searched at: '$DOTFILES/etc/ctags.rust' == "'"$DOTFILES/etc/ctags.rust"'"
exit 1
fi
rm -f TAGS
for SRCDIR in "$@"; do
echo "Indexing $SRCDIR"
if [ ! -d "$SRCDIR" ]; then
echo Source directory "'"$SRCDIR"'" not found.
exit 1
fi
ctags -a -e -f TAGS --options="$DOTFILES/etc/ctags.rust" --languages=Rust --recurse "$SRCDIR"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment