--- /dev/null
+(* HCoop Domtool (http://hcoop.sourceforge.net/)
+ * Copyright (c) 2006, Adam Chlipala
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *)
+
+(* Driver for documentation generation *)
+
+fun processArgs (args, basis, outdir, files) =
+ case args of
+ [] => (basis, outdir, files)
+ | "-basis" :: rest => processArgs (rest, true, outdir, files)
+ | "-out" :: dir :: rest => processArgs (rest, basis, dir, files)
+ | file :: rest => processArgs (rest, basis, outdir, file :: files)
+
+val _ =
+ let
+ val (basis, outdir, files) = processArgs (CommandLine.arguments (),
+ false,
+ OS.FileSys.getDir (),
+ [])
+
+ val files = if basis then
+ Main.listBasis () @ files
+ else
+ files
+ in
+ Tycheck.allowExterns ();
+ Autodoc.autodoc {outdir = outdir, infiles = files}
+ end