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 ...@@ -28,6 +28,7 @@ import System.Posix.Signals
import qualified Data.Map as Map import qualified Data.Map as Map
import qualified Data.Text.Encoding as E import qualified Data.Text.Encoding as E
import Data.List (break, last) import Data.List (break, last)
import Data.Version (showVersion)
-- IHaskell imports. -- IHaskell imports.
import IHaskell.Convert (convert) import IHaskell.Convert (convert)
...@@ -46,6 +47,9 @@ import IHaskell.IPython.Types ...@@ -46,6 +47,9 @@ import IHaskell.IPython.Types
import qualified IHaskell.IPython.Message.UUID as UUID import qualified IHaskell.IPython.Message.UUID as UUID
import qualified IHaskell.IPython.Stdin as Stdin import qualified IHaskell.IPython.Stdin as Stdin
-- Cabal imports.
import Paths_ihaskell(version)
-- GHC API imports. -- GHC API imports.
import GHC hiding (extensions, language) import GHC hiding (extensions, language)
...@@ -86,7 +90,7 @@ showDefault :: String -> [Argument] -> IO () ...@@ -86,7 +90,7 @@ showDefault :: String -> [Argument] -> IO ()
showDefault helpStr flags = showDefault helpStr flags =
case find (== Version) flags of case find (== Version) flags of
Just _ -> Just _ ->
putStrLn VERSION_ipython_kernel putStrLn (showVersion version)
Nothing -> Nothing ->
putStrLn helpStr putStrLn helpStr
...@@ -248,9 +252,9 @@ replyTo _ KernelInfoRequest{} replyHeader state = ...@@ -248,9 +252,9 @@ replyTo _ KernelInfoRequest{} replyHeader state =
(state, KernelInfoReply (state, KernelInfoReply
{ header = replyHeader { header = replyHeader
, protocolVersion = "5.0" , protocolVersion = "5.0"
, banner = "IHaskell " ++ VERSION_ipython_kernel ++ " GHC " ++ VERSION_ghc , banner = "IHaskell " ++ (showVersion version) ++ " GHC " ++ VERSION_ghc
, implementation = "IHaskell" , implementation = "IHaskell"
, implementationVersion = VERSION_ipython_kernel , implementationVersion = showVersion version
, languageInfo = LanguageInfo , languageInfo = LanguageInfo
{ languageName = "haskell" { languageName = "haskell"
, languageVersion = VERSION_ghc , 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