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