File tree Expand file tree Collapse file tree 2 files changed +11
-2
lines changed Expand file tree Collapse file tree 2 files changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -104,7 +104,9 @@ executable hdb
104104 Development.Debug.Adapter.Exit,
105105 Development.Debug.Adapter.Handles,
106106 Development.Debug.Adapter,
107- Development.Debug.Interactive
107+ Development.Debug.Interactive,
108+ Paths_haskell_debugger
109+ autogen-modules : Paths_haskell_debugger
108110 build-depends :
109111 base, ghc,
110112 exceptions, aeson, bytestring,
Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ module Main where
33
44import System.Environment
55import Data.Maybe
6+ import Data.Version
67import Text.Read
78
89import DAP
@@ -27,6 +28,8 @@ import GHC.IO.Handle.FD
2728import Options.Applicative hiding (command )
2829import qualified Options.Applicative
2930
31+ import qualified Paths_haskell_debugger as P
32+
3033-- | The options `hdb` is invoked in the command line with
3134data HdbOptions
3235 -- | @server --port <port>@
@@ -90,9 +93,13 @@ hdbOptionsParser = hsubparser
9093 )
9194 <|> cliParser -- Default to CLI mode if no subcommand
9295
96+ -- | Parser for --version flag
97+ versioner :: Parser (a -> a )
98+ versioner = simpleVersioner $ " Haskell Debugger, version " ++ showVersion P. version
99+
93100-- | Main parser info
94101hdbParserInfo :: ParserInfo HdbOptions
95- hdbParserInfo = info (hdbOptionsParser <**> helper)
102+ hdbParserInfo = info (hdbOptionsParser <**> versioner <**> helper)
96103 ( fullDesc
97104 <> header " Haskell debugger supporting both CLI and DAP modes" )
98105
You can’t perform that action at this time.
0 commit comments