File tree Expand file tree Collapse file tree 3 files changed +10
-5
lines changed
Expand file tree Collapse file tree 3 files changed +10
-5
lines changed Original file line number Diff line number Diff line change 11module Main where
22
3+ import Paths_kda_tool (version )
34------------------------------------------------------------------------------
45import AppMain
56------------------------------------------------------------------------------
67
78main :: IO ()
8- main = appMain
9+ main = appMain version
Original file line number Diff line number Diff line change @@ -112,6 +112,9 @@ executable kda
112112 build-depends :
113113 base
114114 , kda-tool
115+
116+ other-modules : Paths_kda_tool
117+
115118 hs-source-dirs : exe
116119 default-language : Haskell2010
117120 ghc-options : -threaded -Wall -Wno-unticked-promoted-constructors -fno-show-valid-hole-fits
Original file line number Diff line number Diff line change @@ -9,6 +9,7 @@ module AppMain where
99import Control.Monad.IO.Class
1010import Data.Aeson
1111import Data.Default
12+ import Data.Version
1213import Data.String (fromString )
1314import Katip
1415import Network.HTTP.Client hiding (withConnection )
@@ -35,8 +36,9 @@ import Commands.WalletSign
3536import Types.Env
3637------------------------------------------------------------------------------
3738
38- appMain :: IO ()
39- appMain = do
39+
40+ appMain :: Version -> IO ()
41+ appMain version = do
4042 Args c severity verbosity mcf <- execParser opts
4143 mgr <- newManager tlsManagerSettings
4244
@@ -76,7 +78,7 @@ appMain = do
7678 WalletSign args -> walletSignCommand theEnv args
7779
7880 where
79- opts = info (envP <**> helper) $ mconcat
81+ opts = info (envP <**> simpleVersioner (showVersion version) <**> helper) $ mconcat
8082 [ fullDesc
8183 , header " kda - Command line tool for interacting with the Kadena blockchain"
8284 , footerDoc (Just theFooter)
@@ -86,4 +88,3 @@ appMain = do
8688 , " "
8789 , " source <(kda --bash-completion-script `which kda`)"
8890 ]
89-
You can’t perform that action at this time.
0 commit comments