forked from azadkuh/qhttp
-
Notifications
You must be signed in to change notification settings - Fork 1
/
utils.sh
executable file
·61 lines (46 loc) · 1.23 KB
/
utils.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
#!/bin/bash
CTAGS_EXCLUDES_BASE="--exclude=.git --exclude=tmp --exclude=xbin --exclude=res"
CTAGS_OPTIONS_BASE="--c++-kinds=+cefgnps --fields=+iaS --extra=+fq -R ."
CLOC_EXCLUDES_BASE="--exclude-dir=.git,xbin,tmp,res"
CLOC_EXCLUDES_LANGS="--exclude-lang=Prolog,make"
function fn_cloc() {
echo "cloc (exclusive) ..."
cloc $CLOC_EXCLUDES_LANGS $CLOC_EXCLUDES_BASE,3rdparty .
}
function fn_cloc_all() {
echo "cloc all (inclusive) ..."
cloc $CLOC_EXCLUDES_LANGS $CLOC_EXCLUDES_BASE .
}
function fn_ctags() {
echo "ctags (exclusive) ..."
ctags --exclude=3rdparty $CTAGS_EXCLUDES_BASE $CTAGS_OPTIONS_BASE
}
function fn_ctags_all() {
echo "ctags all (inclusive) ..."
ctags $CTAGS_EXCLUDES_BASE $CTAGS_OPTIONS_BASE
}
if [[ $# -eq 0 ]]; then
fn_ctags
else
while [[ $# > 0 ]]; do
arg="$1"
case $arg in
tags|ctags|tag|ctag)
fn_ctags
;;
tags_all|ctags_all|tag_all|fn_ctags_all)
fn_ctags_all
;;
cloc_all)
fn_cloc_all
;;
cloc)
fn_cloc
;;
*)
echo "unknown args as $arg"
;;
esac
shift
done
fi