Commit 5e7a2917 authored by Mark Olesen's avatar Mark Olesen
Browse files

ENH: adjust doxygen wrapper to accept multiple input directories

- the -dir option was added in commit 9fda726a 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.
parent 228f07dc
......@@ -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
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment