ENH: adjust doxygen wrapper to accept multiple input directories

- the -dir option was added in commit c1c6243c3e to allow quick
  testing of documentation for a set of classes.
  This was largely replicated in commit 843d83117, but accepting
  multiple directories.

  Apply some of the same ideas here and avoid creation of a tmp file.
This commit is contained in:
Mark Olesen 2017-09-29 18:36:48 +02:00
parent a531168ae4
commit 0cc4ab73b7

View File

@ -12,7 +12,7 @@ usage() {
while [ "$#" -ge 1 ]; do echo "$1"; shift; done
cat<<USAGE
usage: ${0##*/} [OPTION]
usage: ${0##*/} [OPTION] [dir1 .. dirN]
options:
-config name use alternative doxygen config
-dir name process given directory name directly
@ -20,10 +20,13 @@ options:
local source code
-help
Run doxygen on OpenFOAM sources, or on specified directories only.
USAGE
exit 1
}
# -----------------------------------------------------------------------------
defineURL() {
@ -44,7 +47,7 @@ defineURL() {
}
unset configName dirName
unset configName dirNames
# Parse options
while [ "$#" -gt 0 ]
@ -73,16 +76,30 @@ do
shift
;;
-dir)
dirName="$2"
[ -d "$dirName" ] || {
echo "Could not resolve input directory: $dirName" 1>&2
exit 1
}
shift
if [ -d "$1" ]
then
dirNames="$dirNames $1"
else
echo "Could not resolve input directory: $1" 1>&2
exit 1
fi
;;
-online)
defineURL
;;
-*)
usage "unknown option: '$1'"
;;
*) # dirName
if [ -d "$1" ]
then
dirNames="$dirNames $1"
else
echo "Could not resolve input directory: $1" 1>&2
fi
;;
*)
usage "unknown option/argument: '$1'"
;;
@ -102,14 +119,12 @@ rm -rf html-stagedRemove$$ >/dev/null 2>&1 &
# Ensure that created files are readable by everyone
umask 22
if [ -n "$dirName" ]
if [ -n "$dirNames" ]
then
# Create a temporary with only the specified directory
tmpConfig="${TMPDIR:-/tmp}/Doxyfile.$$"
trap 'rm -f $tmpConfig 2>/dev/null; exit 0' EXIT TERM INT
cat $PWD/Doxyfile > $tmpConfig
echo "INPUT = $dirName" >> $tmpConfig
doxygen $tmpConfig
(
cat ${configName:-Doxyfile}
echo "INPUT = $dirNames"
) | doxygen -
else
doxygen $configName
fi