Add filter-out option, relabel some options, for doxygen.warning.report.sh

This commit is contained in:
Peter D. Barnes, Jr.
2015-08-12 14:57:34 -07:00
parent baddf3f749
commit f39a77b1a5

View File

@@ -25,21 +25,22 @@ function usage
{
cat <<-EOF
Usage: $me [-eithv] [-f <log-file> | -l | -s] [-m <module> | -F <regex>]
Usage: $me [-eithv] [-s <log-file> | -l | -w] [-m <module>] [-f <regex>] [-F <regex>]
Run doxygen to generate all errors; report error counts
by module and file.
-i Skip build and print-introspected-doxygen.
-f Skip doxygen run; use existing <log-file>.
-s Skip doxygen run; use existing warnings log doc/$WARNINGSLOGFILE
-s Skip doxygen run; use existing <log-file>.
-w Skip doxygen run; use existing warnings log doc/$WARNINGSLOGFILE
-l Skip doxygen run; use the normal doxygen log doc/$STANDARDLOGFILE
-e Filter out warnings from */examples/*
-t Filter out warnings from */test/*
-m Only include files matching src/<module>
-F Only include files matching the <regex>
-f Only include files matching the <regex>
-F Exclude files matching the <regex>
-v Show the doxygen run output
-h Print this usage message
@@ -120,41 +121,44 @@ skip_intro=0
filter_examples=0
filter_test=0
filter_module=""
filter_regex=""
filter_in=""
filter_out=""
echo
echo "$me:"
while getopts :eitm:F:lF:svh option ; do
while getopts :ef:F:hilm:s:tvw option ; do
case $option in
(e) filter_examples=1 ;;
(i) skip_intro=1 ;;
(f) filter_in="$OPTARG" ;;
(F) filter_out="$OPTARG" ;;
(h) usage ;;
(t) filter_test=1 ;;
(i) skip_intro=1 ;;
(l) use_standard=1 ;;
(m) filter_module="$OPTARG" ;;
(F) filter_regex="$OPTARG" ;;
(l) use_standard=1 ;;
(f) use_filearg=1
(s) use_filearg=1
logfile_arg="$OPTARG"
;;
(s) use_filearg=1
logfile_arg="$DIR/$WARNINGSLOGFILE"
;;
(t) filter_test=1 ;;
(v) verbosity=1
exec 6>&1
;;
(h) usage ;;
(w) use_filearg=1
logfile_arg="$DIR/$WARNINGSLOGFILE"
;;
(:) echo "$me: Missing argument to -$OPTARG" ; usage ;;
(\?) echo "$me: Invalid option: -$OPTARG" ; usage ;;
@@ -220,16 +224,16 @@ fi
# Log filters --------------------------
#
# Filter regular expression for -m and -F
# Filter in regular expression for -m and -f
filter_inRE=""
if [ "$filter_module" != "" ] ; then
filter_inRE="${filter_inRE:-}${filter_inRE:+\\|}src/$filter_module"
fi
if [ "$filter_regex" != "" ] ; then
filter_inRE="${filter_inRE:-}${filter_inRE:+\\|}$filter_regex"
if [ "$filter_in" != "" ] ; then
filter_inRE="${filter_inRE:-}${filter_inRE:+\\|}$filter_in"
fi
# Filter regular expression for -e and -t
# Filter out regular expression for -e, -t and -F
filter_outRE=""
if [ $filter_examples -eq 1 ]; then
filter_outRE="${filter_outRE:-}${filter_outRE:+\\|}/examples/"
@@ -237,7 +241,11 @@ fi
if [ $filter_test -eq 1 ]; then
filter_outRE="${filter_outRE:-}${filter_outRE:+\\|}/test/"
fi
if [ "$filter_out" != "" ] ; then
filter_outRE="${filter_outRE:-}${filter_outRE:+\\|}$filter_out"
fi
# Show the resulting filters
if [ "${filter_inRE:-}" != "" ] ; then
echo "Filtering in \"$filter_inRE\""
fi