diff options
author | defanor <defanor@uberspace.net> | 2017-11-13 00:15:12 +0300 |
---|---|---|
committer | defanor <defanor@uberspace.net> | 2017-11-13 00:15:12 +0300 |
commit | 36f86bfe407e261c102eabfc65397fdf23661ee8 (patch) | |
tree | c6b52392429bdbe808048980882d76a32143881d /Pancake.hs | |
parent | fae50fdc7ae4a200ef17e40c9ac41eb42518f6c6 (diff) |
Handle the --version option
Diffstat (limited to 'Pancake.hs')
-rw-r--r-- | Pancake.hs | 10 |
1 files changed, 7 insertions, 3 deletions
@@ -32,6 +32,7 @@ import Control.Exception import Data.Char import System.IO.Error import Control.Applicative +import Data.Version import Pancake.Common import Pancake.Configuration @@ -39,6 +40,7 @@ import Pancake.Command import Pancake.Reading import Pancake.Rendering import Pancake.Printing +import Paths_pancake -- | A zipper kind of thing, for scrolling and history traversal. type Sliding a = ([a], [a]) @@ -250,6 +252,8 @@ eventLoop = do main :: IO () main = do args <- getArgs - _ <- runStateT (updateConfig >> eventLoop) $ - LS ([],[]) 0 [] def ("--embedded" `elem` args) - pure () + if "--version" `elem` args + then putStrLn $ "pancake " ++ showVersion version + else runStateT (updateConfig >> eventLoop) + (LS ([],[]) 0 [] def ("--embedded" `elem` args)) + >> pure () |