on master help sign in
Name changes for flags
9d678a1Evan Czaplicki
compiler/Build/Flags.hs+6−6
@@ -7,7 +7,8 @@ import System.Console.CmdArgs
7data Flags = Flags
7data Flags = Flags
8 { make :: Bool
8 { make :: Bool
9 , files :: [FilePath]
9 , files :: [FilePath]
10− , runtime :: Maybe FilePath
10+ , set_runtime :: Maybe FilePath
11+ , get_runtime :: Bool
11 , only_js :: Bool
12 , only_js :: Bool
12 , print_types :: Bool
13 , print_types :: Bool
13 , scripts :: [FilePath]
14 , scripts :: [FilePath]
@@ -15,7 +16,6 @@ data Flags = Flags
15 , cache_dir :: FilePath
16 , cache_dir :: FilePath
16 , build_dir :: FilePath
17 , build_dir :: FilePath
17 , src_dir :: [FilePath]
18 , src_dir :: [FilePath]
18− , show_runtime :: Bool
19 }
19 }
20 deriving (Data,Typeable,Show,Eq)
20 deriving (Data,Typeable,Show,Eq)
21
21
@@ -29,8 +29,10 @@ flags = Flags
29 &= help "Do not import Prelude by default, used only when compiling standard libraries."
29 &= help "Do not import Prelude by default, used only when compiling standard libraries."
30 , scripts = [] &= typFile
30 , scripts = [] &= typFile
31 &= help "Load JavaScript files in generated HTML. Files will be included in the given order."
31 &= help "Load JavaScript files in generated HTML. Files will be included in the given order."
32− , runtime = Nothing &= typFile
32+ , set_runtime = Nothing &= typFile
33− &= help "Specify a custom location for Elm's runtime system."
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."
34 , cache_dir = "cache" &= typFile
36 , cache_dir = "cache" &= typFile
35 &= help "Directory for files cached to make builds faster. Defaults to cache/ directory."
37 &= help "Directory for files cached to make builds faster. Defaults to cache/ directory."
36 , build_dir = "build" &= typFile
38 , build_dir = "build" &= typFile
@@ -39,8 +41,6 @@ flags = Flags
39 &= help "Additional source directories besides project root. Searched when using --make"
41 &= help "Additional source directories besides project root. Searched when using --make"
40 , print_types = False
42 , print_types = False
41 &= help "Print out inferred types of top-level definitions."
43 &= help "Print out inferred types of top-level definitions."
42− , show_runtime = False
43− &= help "Print the absolute path to the default Elm runtime."
44 } &= help "Compile Elm programs to HTML, CSS, and JavaScript."
44 } &= help "Compile Elm programs to HTML, CSS, and JavaScript."
45 &= helpArg [explicit, name "help", name "h"]
45 &= helpArg [explicit, name "help", name "h"]
46 &= versionArg [explicit, name "version", name "v", summary (show Version.elmVersion)]
46 &= versionArg [explicit, name "version", name "v", summary (show Version.elmVersion)]
compiler/Compiler.hs+2−2
@@ -25,7 +25,7 @@ main = do setNumCapabilities =<< getNumProcessors
25
25
26compileArgs :: Flag.Flags -> IO ()
26compileArgs :: Flag.Flags -> IO ()
27compileArgs flags =
27compileArgs flags =
28− do when (Flag.show_runtime flags) $
28+ do when (Flag.get_runtime flags) $
29 do putStrLn Path.runtime
29 do putStrLn Path.runtime
30 exitSuccess
30 exitSuccess
31 case Flag.files flags of
31 case Flag.files flags of
@@ -67,5 +67,5 @@ build flags rootFile =
67
67
68 makeHtml js moduleName = ("html", BS.pack $ renderHtml html)
68 makeHtml js moduleName = ("html", BS.pack $ renderHtml html)
69 where
69 where
70− rtsPath = Maybe.fromMaybe Path.runtime (Flag.runtime flags)
70+ rtsPath = Maybe.fromMaybe Path.runtime (Flag.set_runtime flags)
71 html = Html.generate rtsPath (takeBaseName rootFile) (sources js) moduleName ""
71 html = Html.generate rtsPath (takeBaseName rootFile) (sources js) moduleName ""