@@ -46,27 +46,29 @@ data Flags =
46 deriving (Data,Typeable,Show,Eq)
46 deriving (Data,Typeable,Show,Eq)
48flags = Flags
48flags = Flags
49+ { files = def &= args &= typ "FILES"
49− { make = False
50+ , make = False
50 &= help "automatically compile dependencies."
51 &= help "automatically compile dependencies."
51− , files = def &= args &= typ "FILES"
52− , runtime = Nothing &= typFile
53− &= help "Specify a custom location for Elm's runtime system."
54 , only_js = False
52 , only_js = False
55 &= help "Compile only to JavaScript."
53 &= help "Compile only to JavaScript."
56− , print_types = False
57− &= help "Print out infered types of top-level definitions."
58− , print_program = False
59− &= help "Print out an internal representation of a program."
60− , scripts = [] &= typFile
61− &= help "Load JavaScript files in generated HTML. Files will be included in the given order."
62 , no_prelude = False
54 , no_prelude = False
63 &= help "Do not import Prelude by default, used only when compiling standard libraries."
55 &= help "Do not import Prelude by default, used only when compiling standard libraries."
56+ , scripts = [] &= typFile
57+ &= help "Load JavaScript files in generated HTML. Files will be included in the given order."
58+ , runtime = Nothing &= typFile
59+ &= help "Specify a custom location for Elm's runtime system."
64 , cache_dir = "cache" &= typFile
60 , cache_dir = "cache" &= typFile
65 &= help "Directory for files cached to make builds faster. Defaults to cache/ directory."
61 &= help "Directory for files cached to make builds faster. Defaults to cache/ directory."
66 , build_dir = "build" &= typFile
62 , build_dir = "build" &= typFile
67 &= help "Directory for generated HTML and JS files. Defaults to build/ directory."
63 &= help "Directory for generated HTML and JS files. Defaults to build/ directory."
64+ , print_types = False
65+ &= help "Print out infered types of top-level definitions."
66+ , print_program = False
67+ &= help "Print out an internal representation of a program."
68 } &= help "Compile Elm programs to HTML, CSS, and JavaScript."
68 } &= help "Compile Elm programs to HTML, CSS, and JavaScript."
69+ &= helpArg [explicit, name "help", name "h"]
70+ &= versionArg [explicit, name "version", name "v", summary (showVersion version)]
69− &= summary ("The Elm Compiler " ++ showVersion version ++ ", (c) Evan Czaplicki")
71+ &= summary ("The Elm Compiler " ++ showVersion version ++ ", (c) Evan Czaplicki 2011-2013")
71main :: IO ()
73main :: IO ()
72main = do setNumCapabilities =<< getNumProcessors
74main = do setNumCapabilities =<< getNumProcessors