Commit ed3b892e authored by Nicholas Luo's avatar Nicholas Luo

Use Paths_ihaskell provided by cabal to get IHaskell version number

parent b2c8b1f0
......@@ -28,6 +28,7 @@ import System.Posix.Signals
import qualified Data.Map as Map
import qualified Data.Text.Encoding as E
import Data.List (break, last)
import Data.Version (showVersion)
-- IHaskell imports.
import IHaskell.Convert (convert)
......@@ -46,6 +47,9 @@ import IHaskell.IPython.Types
import qualified IHaskell.IPython.Message.UUID as UUID
import qualified IHaskell.IPython.Stdin as Stdin
-- Cabal imports.
import Paths_ihaskell(version)
-- GHC API imports.
import GHC hiding (extensions, language)
......@@ -86,7 +90,7 @@ showDefault :: String -> [Argument] -> IO ()
showDefault helpStr flags =
case find (== Version) flags of
Just _ ->
putStrLn VERSION_ipython_kernel
putStrLn (showVersion version)
Nothing ->
putStrLn helpStr
......@@ -248,9 +252,9 @@ replyTo _ KernelInfoRequest{} replyHeader state =
(state, KernelInfoReply
{ header = replyHeader
, protocolVersion = "5.0"
, banner = "IHaskell " ++ VERSION_ipython_kernel ++ " GHC " ++ VERSION_ghc
, banner = "IHaskell " ++ (showVersion version) ++ " GHC " ++ VERSION_ghc
, implementation = "IHaskell"
, implementationVersion = VERSION_ipython_kernel
, implementationVersion = showVersion version
, languageInfo = LanguageInfo
{ languageName = "haskell"
, languageVersion = VERSION_ghc
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment