Created
August 2, 2014 18:35
-
-
Save huzhifeng/16dce14e9f4d595484db to your computer and use it in GitHub Desktop.
Automatic cscope
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
cs_install() { | |
echo "installing ..." | |
if [ ! -e cscope.files ] | |
then | |
find ./ -name "*.[hc]" > cscope.files | |
else | |
echo "cscope.files exist" | |
fi | |
if [ ! -e cscope.out ] | |
then | |
cscope -bkq -i cscope.files | |
else | |
echo "cscope.out exist" | |
fi | |
if [ ! -e tags ] | |
then | |
ctags -R | |
else | |
echo "tags exist" | |
fi | |
echo "installing finished" | |
} | |
cs_clean() { | |
echo "cleaning ..." | |
rm -rf cscope.* tags | |
echo "cleaning finished" | |
} | |
if [ $# == 0 ] | |
then | |
action="install" | |
else | |
action=$1 | |
fi | |
case "$action" in | |
install) | |
cs_install | |
;; | |
clean) | |
cs_clean | |
;; | |
update) | |
cs_clean | |
cs_install | |
;; | |
esac |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment