on master help sign in
Fix #1286, support --version flag
commit1950b466f2713022ed3eb8a110db6a8802b1f930 authorEvan Czaplicki <info@elm-lang.org> dateTue 7 Jun 2016, 11:41 (10 years ago) parentc454cf4
1 file changed+9−1
src/CommandLineRouter.hs+9−1
src/CommandLineRouter.hs+9−1
@@ -10,6 +10,8 @@ import GHC.IO.Encoding (setLocaleEncoding, utf8)
1010import qualified Elm.Compiler.Version as Compiler
1111import qualified Elm.Package as Pkg
1212
13+
14+
1315main :: IO ()
1416main =
1517 do setLocaleEncoding utf8
@@ -19,6 +21,12 @@ main =
1921 [] ->
2022 putStrLn usageMessage
2123
24+ "--version" ->
25+ putStrLn $ Pkg.versionToString Compiler.version
26+
27+ "-v" ->
28+ putStrLn $ Pkg.versionToString Compiler.version
29+
2230 command : args ->
2331 attemptToRun command args
2432
@@ -50,7 +58,7 @@ attemptToRun command args =
5058
5159usageMessage :: String
5260usageMessage =
53− "Elm Platform " ++ (Pkg.versionToString Compiler.version) ++ " - a way to run all Elm tools\n\
61+ "Elm Platform " ++ Pkg.versionToString Compiler.version ++ " - a way to run all Elm tools\n\
5462 \\n\
5563 \Usage: elm <command> [<args>]\n\
5664 \\n\