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