mirror of
https://github.com/DarkPlacesEngine/gmqcc.git
synced 2024-11-27 14:12:36 +00:00
misc/check-doc.sh
This commit is contained in:
parent
1759388e3f
commit
d6f6241872
1 changed files with 43 additions and 0 deletions
43
misc/check-doc.sh
Normal file
43
misc/check-doc.sh
Normal file
|
@ -0,0 +1,43 @@
|
|||
#!/bin/sh
|
||||
prog=$0
|
||||
|
||||
die() {
|
||||
echo "$@"
|
||||
exit 1
|
||||
}
|
||||
|
||||
want() {
|
||||
test -e "$1" && return
|
||||
echo "$prog: missing $1"
|
||||
echo "$prog: run this script from the top of a gmqcc source tree"
|
||||
exit 1
|
||||
}
|
||||
|
||||
for i in opts.def \
|
||||
doc/gmqcc.1 \
|
||||
gmqcc.ini.example
|
||||
do want "$i"; done
|
||||
|
||||
# y/_ABCDEFGHIJKLMNOPQRSTUVWXYZ/-abcdefghijklmnopqrstuvwxyz/;
|
||||
check_opt() {
|
||||
opt_def_name=$1
|
||||
arg_char=$2
|
||||
|
||||
for i in $(sed -ne \
|
||||
'/^#ifdef GMQCC_TYPE_'${opt_def_name}'$/,/^#endif/{
|
||||
/GMQCC_DEFINE_FLAG/{
|
||||
s/^.*GMQCC_DEFINE_FLAG(\([^,)]*\)[),].*$/\1/;p;
|
||||
}
|
||||
}' opts.def)
|
||||
do
|
||||
opt=$(echo "$i" | tr -- '_A-Z' '-a-z')
|
||||
grep -qF -- ".It Fl "${arg_char}" Ns Cm $opt" \
|
||||
doc/gmqcc.1 || echo "doc/gmqcc.1: missing: -${arg_char}$opt"
|
||||
grep -q -- "[^a-zA-Z_]$i[^a-zA-Z_]" \
|
||||
gmqcc.ini.example || echo "gmqcc.ini.example: missing: $i"
|
||||
done
|
||||
}
|
||||
|
||||
check_opt FLAGS f
|
||||
check_opt WARNS W
|
||||
check_opt OPTIMIZATIONS O
|
Loading…
Reference in a new issue