@@ -31,6 +31,8 @@ import qualified Data.Text.Lazy as L
3131import qualified Data.Text.Lazy.Encoding as L
3232import qualified Data.ByteString as B
3333
34+import Development.GitRev
35+
3436import Language.PureScript.AST.Literals
3537import Language.PureScript.CoreFn
3638import Language.PureScript.CoreFn.FromJSON
@@ -62,8 +64,15 @@ main = do
6264 if "--tests" `elem` opts'
6365 then runTests
6466 else do
65− if "--help" `elem` opts'
66− then putStrLn help
67+ if "--help" `elem` opts' || "--version" `elem` opts'
68+ then do
69+ when ("--help" `elem` opts') $ do
70+ putStrLn help
71+ when ("--version" `elem` opts') $ do
72+ let branch = $(gitBranch)
73+ details | branch == "golang" = "master, commit " ++ $(gitHash)
74+ | otherwise = branch
75+ putStrLn $ details ++ if $(gitDirty) then " (DIRTY)" else ""
6776 else do
6877 if null files
6978 then do