Skip to content

Commit e18e0c4

Browse files
committed
Show version number in executable help
1 parent 3641b9b commit e18e0c4

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

ChangeLog.md

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
* Library: Fix regex to capture "Failed, one module loaded"
77
* Tests: Add basic test suite, covering module loading, expression execution, exceptions, and filesystem notification-based reloading.
88
* Library: Reset module output pane scroll position on reload events (like we do with the expression output pane).
9+
* Executable: Show executable version number (taken from cabal file) in help output
910

1011
## 0.1.3.1
1112

reflex-ghci.cabal

+1
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ executable reflex-ghci
5656
, reflex-process
5757
, text
5858
, vty
59+
other-modules: Paths_reflex_ghci
5960
ghc-options: -threaded -rtsopts
6061
default-language: Haskell2010
6162

src-bin/ghci.hs

+6-4
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,13 @@ import Reflex.Vty.GHCi
55

66
import Control.Concurrent (threadDelay)
77
import Control.Monad.IO.Class (liftIO)
8-
import qualified Graphics.Vty.Input as V
98
import qualified Data.Text as T
109
import qualified Data.Text.Encoding as T
11-
import System.Process (shell, terminateProcess)
12-
10+
import Data.Version (showVersion)
11+
import qualified Graphics.Vty.Input as V
1312
import Options.Applicative
13+
import Paths_reflex_ghci (version)
14+
import System.Process (shell, terminateProcess)
1415

1516
data GhciArg = GhciArg
1617
{ _ghciArg_replCommand :: String
@@ -39,7 +40,8 @@ main = do
3940
let opts = info (ghciArg <**> helper) $ mconcat
4041
[ fullDesc
4142
, progDesc "Run a Haskell REPL that automatically reloads when source files change."
42-
, header "Welcome to reflex-ghci!"
43+
, header $ "Welcome to reflex-ghci " <>
44+
showVersion version
4345
]
4446
GhciArg { _ghciArg_replCommand = cmd, _ghciArg_execCommand = expr } <- execParser opts
4547
mainWidget $ do

0 commit comments

Comments
 (0)