-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.sh
executable file
·85 lines (69 loc) · 1.54 KB
/
setup.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
#!/bin/bash
function creat_cscope()
{
if [ -e "cscope.files" ]; then
rm -rf cscope.files
fi
echo "create cscope.files in $@"
for arg in $@
do
find ${arg} -type f |sed -e '/ /d' -n -e '/\.\(\([chmSs]\)\|\(java\)\|\(cpp\)\|\(hp\)\|\(cc\)\|\(def\)\)$/p' >> cscope.files
done
echo "create cscope"
cscope -bki cscope.files
}
function csset()
{
if [ $# -eq 0 ];then
echo "need dirname"
return
fi
csclean
creat_cscope $@
echo "create tags"
ctags --c++-kinds=+px --fields=+iaS --extra=+q -L cscope.files
echo "create success"
}
function csseta()
{
if [ $# -eq 0 ];then
echo "need dirname"
return
fi
csclean
creat_cscope $@
rm -rf cscope.files tags TAGS
for arg in $@
do
find ${arg} -type f | sed '/\/\.\| \|\.o\|\.taghl\|tags\|cscope\|\.a/d' >> cscope.files
done
echo "create tags"
ctags --c++-kinds=+px --fields=+iaS --extra=+q -L cscope.files
echo "create success"
}
function csclean()
{
if [ $# -eq 0 ];then
rm -rf cscope* tags TAGS ncscope*
else
for arg in $@
do
find $arg -type f -name "cscope.*" -o -name tags |xargs rm -rf
done
fi
}
function cscleana()
{
if [ $# -eq 0 ];then
rm -rf cscope* tags TAGS *.taghl
else
for arg in $@
do
find $arg -type f -name "cscope.*" -o -name tags -o -name "*.taghl" -o -name TAGS |xargs rm -rf
done
fi
}
function ll()
{
ls -l $*
}