-
Notifications
You must be signed in to change notification settings - Fork 21
/
stat_color
executable file
·52 lines (39 loc) · 1.03 KB
/
stat_color
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
#!/bin/sh
# CoLoR, a Coq library on rewriting and termination.
# See the COPYRIGHTS and LICENSE files.
#
# - Frederic Blanqui, 2007-04-17
prog=`basename $0`
usage () {
echo "usage: $prog [-h]"
}
help () {
cat <<EOF
Provides the number of lines for the various kinds of formalizations.
Options:
-h Provide this help and exit
EOF
}
case "$1" in
-h) usage; echo; help; exit 0;;
esac
if test $# -ne 0; then usage; exit 1; fi
lines () {
wc -l /dev/null `find $dir -path ./Coccinelle -prune -o -name \*.v -print` | grep total | sed 's|total||'
}
dir=.; total=`lines`
dir=Util; data=`lines`
dir=Term; term=`lines`
dir='Util/Logic Util/Relation Util/Algebra'; math=`lines`
data=`expr $data - $math`
termin=`expr $total - $data - $term - $math`
display () {
mean=`expr 1000 \* $val / $total | sed 's|\(.*\)\([0-9]\)$|\1.\2|'`
# mean=`expr 100 \* $val / $total`
echo $dir $val $mean%
}
dir=Data; val=$data; display
dir=Term; val=$term; display
dir=Math; val=$math; display
dir=Termin; val=$termin; display
dir=Total; val=$total; display