on 63243ca help sign in
elk/compiler/Build/Flags.hs
44 lines 1.9 kB history raw
1{-# LANGUAGE DeriveDataTypeable #-}
2module Build.Flags where
4import qualified Elm.Internal.Version as Version
5import System.Console.CmdArgs
7data Flags = Flags
8 { make :: Bool
9 , files :: [FilePath]
10 , runtime :: Maybe FilePath
11 , only_js :: Bool
12 , print_types :: Bool
13 , scripts :: [FilePath]
14 , no_prelude :: Bool
15 , cache_dir :: FilePath
16 , build_dir :: FilePath
17 , src_dir :: [FilePath]
18 }
19 deriving (Data,Typeable,Show,Eq)
21flags = Flags
22 { files = def &= args &= typ "FILES"
23 , make = False
24 &= help "automatically compile dependencies."
25 , only_js = False
26 &= help "Compile only to JavaScript."
27 , no_prelude = False
28 &= help "Do not import Prelude by default, used only when compiling standard libraries."
29 , scripts = [] &= typFile
30 &= help "Load JavaScript files in generated HTML. Files will be included in the given order."
31 , runtime = Nothing &= typFile
32 &= help "Specify a custom location for Elm's runtime system."
33 , cache_dir = "cache" &= typFile
34 &= help "Directory for files cached to make builds faster. Defaults to cache/ directory."
35 , build_dir = "build" &= typFile
36 &= help "Directory for generated HTML and JS files. Defaults to build/ directory."
37 , src_dir = ["."] &= typFile
38 &= help "Additional source directories besides project root. Searched when using --make"
39 , print_types = False
40 &= help "Print out infered types of top-level definitions."
41 } &= help "Compile Elm programs to HTML, CSS, and JavaScript."
42 &= helpArg [explicit, name "help", name "h"]
43 &= versionArg [explicit, name "version", name "v", summary (show Version.elmVersion)]
44 &= summary ("The Elm Compiler " ++ show Version.elmVersion ++ ", (c) Evan Czaplicki 2011-2013")