module Diagrams.Builder.CmdLine
( Build(..)
, defaultBuildOpts
)
where
import System.Console.CmdArgs
data Build = Build { width :: Maybe Double
, height :: Maybe Double
, srcFile :: String
, expr :: String
, outFile :: String
, dir :: String
}
deriving (Typeable, Data)
defaultBuildOpts :: Build
defaultBuildOpts =
Build
{ width = def &= typ "INT"
, height = def &= typ "INT"
, srcFile = "" &= argPos 0 &= typFile
, expr = "dia"
&= typ "EXPRESSION"
&= help "Expression to render (default: \"dia\")"
, outFile = def &= typFile &= help "Output file"
, dir = ".diagrams_cache"
&= typDir
&= help "Directory in which to store rendered diagrams by hash (default: \".diagrams_cache\")"
}