Source

pronk / app / App.hs

Diff from to

File app/App.hs

-{-# LANGUAGE BangPatterns, CPP, DeriveDataTypeable, OverloadedStrings,
+{-# LANGUAGE BangPatterns, DeriveDataTypeable, OverloadedStrings,
     RecordWildCards, ScopedTypeVariables #-}
 
 module Main (main) where
 import Data.Text.Encoding (encodeUtf8)
 import Data.Text.Lazy.Builder (toLazyText)
 import Data.Time.Clock.POSIX (getPOSIXTime)
+import Data.Version (showVersion)
 import Network.HTTP.LoadTest (NetworkError(..), Req(..))
 import Network.HTTP.LoadTest.Analysis (analyseBasic, analyseFull)
 import Network.HTTP.LoadTest.Environment (environment)
 import Network.HTTP.LoadTest.Report
 import Network.Socket (withSocketsDo)
+import Paths_pronk (version)
 import Prelude hiding (catch)
 import System.CPUTime (getCPUTime)
 import System.Console.CmdArgs
     , json :: Maybe FilePath
     } deriving (Eq, Show, Typeable, Data)
 
+pronk_version :: String
+pronk_version = showVersion version
+
 defaultArgs :: Args
 defaultArgs = Args {
                 concurrency = 1
               , json = def &= typ "FILE"
                 &= help "Save analysis in JSON format"
               } &= verbosity
-                &= summary ("Pronk " ++ VERSION_pronk ++
+                &= summary ("Pronk " ++ pronk_version ++
                             " - a modern HTTP load tester")
 
 fromArgs :: Args -> E.Request IO -> LoadTest.Config