on e123780 help sign in
elk/compiler/Build/Flags.hs
47 lines 2.0 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 , set_runtime :: Maybe FilePath
11 , get_runtime :: Bool
12 , only_js :: Bool
13 , print_types :: Bool
14 , scripts :: [FilePath]
15 , no_prelude :: Bool
16 , cache_dir :: FilePath
17 , build_dir :: FilePath
18 , src_dir :: [FilePath]
19 }
20 deriving (Data,Typeable,Show,Eq)
22flags = Flags
23 { files = def &= args &= typ "FILES"
24 , make = False
25 &= help "automatically compile dependencies."
26 , only_js = False
27 &= help "Compile only to JavaScript."
28 , no_prelude = False
29 &= help "Do not import Prelude by default, used only when compiling standard libraries."
30 , scripts = [] &= typFile
31 &= help "Load JavaScript files in generated HTML. Files will be included in the given order."
32 , set_runtime = Nothing &= typFile
33 &= help "Specify a custom location for Elm's runtime system."
34 , get_runtime = False
35 &= help "Print the absolute path to the default Elm runtime."
36 , cache_dir = "cache" &= typFile
37 &= help "Directory for files cached to make builds faster. Defaults to cache/ directory."
38 , build_dir = "build" &= typFile
39 &= help "Directory for generated HTML and JS files. Defaults to build/ directory."
40 , src_dir = ["."] &= typFile
41 &= help "Additional source directories besides project root. Searched when using --make"
42 , print_types = False
43 &= help "Print out inferred types of top-level definitions."
44 } &= help "Compile Elm programs to HTML, CSS, and JavaScript."
45 &= helpArg [explicit, name "help", name "h"]
46 &= versionArg [explicit, name "version", name "v", summary (show Version.elmVersion)]
47 &= summary ("The Elm Compiler " ++ show Version.elmVersion ++ ", (c) Evan Czaplicki 2011-2014")