Main

Main.hs

Copyright © 2007 Dave Bayer. Subject to a BSD-style license.

This module is part of the Annote project.

module Main where

main processes command line arguments, and calls annote.


System.Environment accesses the command line arguments. We import the following function:

getArgs :: IO [String]
import System.Environment (getArgs)

GetOpt handles command line options. It is a wrapper around System.Console.GetOpt.

import GetOpt (parseOptions)

Options declares the command line options.

import Options (Flag(Version,Help),flags,defaults,usage)

Strings provides the string version.

import Strings (version)

Convert processes source files into HTML documentation.

import Convert (style,annote)

main

main processes the command line arguments, calls style to write the style sheet "style.css" if necessary, and then calls annote to produce documentation for each input file.

main :: IO ()
main = do
    args ← getArgs
    (options, files) ←
        parseOptions args defaults usage flags Version version Help
    if not $ null files
        then style options
        else return ()
    mapM_ (annote options) files