#!/usr/local/bin/tclsh

# Library functions for the batch_queue library 
#
# File: batch_queue/doc/create_documenation.tcl
# 
# $Revision: 391732 $ on $Date: 2004-03-01 20:31:57 -0500 (Mon, 01 Mar 2004) $
# 
# Copyright (c) 1993-2003 ICEM CFD Engineering
#
# ------------------------------------------------------------------------------------


## Create the documentation for files in the batch_queue/lib dir.

proc create_library_documenation {libdoc_file} {
    global batch_queue_doc_dir
    
    if [catch {source [file join $batch_queue_doc_dir .. .. guibase makedoc.tcl]} res] {
	puts "Error: $res"
	return FAILURE
    }

    set title "batch_queue module programmer's guide"
    
    set libfiles [glob -nocomplain -type f [file join $batch_queue_doc_dir .. lib *.tcl]]
    
    makedoc $libdoc_file [lsort $libfiles] $title

    if ![file exists $libdoc_file] {
	puts "Error: could not write batch_queue library documenation to \"$libdoc_file!\""
	return FAILURE
    }
    
    puts "Wrote batch_queue library documenation to \"$libdoc_file\""
    return SUCCESS
}


## --> main

set batch_queue_doc_dir [file dir [info script]]

set libdoc_file [file join $batch_queue_doc_dir "library_documentation.html"]

foreach {n v} $argv {
    set [string range $n 1 end] $v
}

create_library_documenation $libdoc_file
