diff options
Diffstat (limited to 'tools')
-rw-r--r-- | tools/shman.sh | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/tools/shman.sh b/tools/shman.sh index 5b1a254..70d56c0 100644 --- a/tools/shman.sh +++ b/tools/shman.sh @@ -201,8 +201,7 @@ parse_docs() local source="${2}" local manual="${3}" local out_dir="${4}" - local tags="${5}" - shift 5 + shift 4 local date= local line= local doc='' @@ -211,10 +210,6 @@ parse_docs() date="$(get_mtime "${file}")" - if [ -n "${tags}" ]; then - exec 3>"${tags}" - fi - while IFS='' read -r line; do case "${line}" in '##'*) @@ -250,10 +245,6 @@ parse_docs() warn 'Undocumented function "%s"' "${line}" fi done <"${file}" - - if [ -n "${tags}" ]; then - exec 3>&- - fi } usage() @@ -328,9 +319,15 @@ main() exit 1 fi + if [ -n "${tags}" ]; then + exec 3>"${tags}" + fi for f in "${@}"; do - parse_docs "${f}" "${source}" "${manual}" "${out_dir}" "${tags}" + parse_docs "${f}" "${source}" "${manual}" "${out_dir}" done + if [ -n "${tags}" ]; then + exec 3>&- + fi } main "${@}" |