definition:
|
main :: IO ()
main = do
allargs <- getArgs
let (rcdefs, args) = readRcOptions allargs
config <- readConfiguration rcdefs
case args of
["genhtml"] -> writePackageIndexAsHTML config "CPM"
["genhtml",d] -> writePackageIndexAsHTML config d
["genhtml",d,p,v] -> writePackageVersionAsHTML config d p v
["genreadme"] -> writeReadmeFiles config "CPM"
["genreadme",d] -> writeReadmeFiles config d
["gendocs"] -> generateDocsOfAllPackages config rcdefs packageDocDir
["gendocs",d] -> getAbsolutePath d >>=
generateDocsOfAllPackages config rcdefs
["gentar"] -> genTarOfAllPackages config packageTarDir
["gentar",d] -> getAbsolutePath d >>= genTarOfAllPackages config
["testall"] -> testAllPackages config rcdefs ""
["testall",d] -> getAbsolutePath d >>= testAllPackages config rcdefs
["sumcsv",d] -> do ad <- getAbsolutePath d
sumCSVStatsOfPkgs ad "SUM.csv"
["showgraph"] -> visualizePackageDependencies config ""
["showgraph",p] -> visualizePackageDependencies config p
["packagelist"] -> getPackageDependencies config >>= putStrLn . showCSV
["writeall"] -> writeAllPackages config
["writedeps"] -> writeAllPackageDependencies config
["writemods"] -> writeAllPackageModules config rcdefs
["copydocs"] -> copyPackageDocumentations config packageDocDir
["copydocs",d] -> getAbsolutePath d >>= copyPackageDocumentations config
["config"] -> printConfig config
["--help"] -> putStrLn helpText
["-h"] -> putStrLn helpText
_ -> do putStrLn $ "Illegal arguments: " ++ unwords args
putStrLn helpText
exitWith 1
|