[commit: ghc] master: "hpc version" now shows the version number from the .cabal file (b610a84)

Ian Lynagh <[email protected]>
Newsgroups gmane.comp.lang.haskell.cvs.ghc
Message-ID <[email protected]>
Repository : ssh://darcs.haskell.org//srv/darcs/ghc

On branch  : master

http://hackage.haskell.org/trac/ghc/changeset/b610a84d089f0ef5d5b1c0250884bce9d0d28ad8

>---------------------------------------------------------------

commit b610a84d089f0ef5d5b1c0250884bce9d0d28ad8
Author: Ian Lynagh <[email protected]>
Date:   Fri Nov 23 17:07:05 2012 +0000

    "hpc version" now shows the version number from the .cabal file

>---------------------------------------------------------------

 utils/hpc/Main.hs       |    6 ++++--
 utils/hpc/hpc-bin.cabal |    1 +
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/utils/hpc/Main.hs b/utils/hpc/Main.hs
index 419a519..cb1eec6 100644
--- a/utils/hpc/Main.hs
+++ b/utils/hpc/Main.hs
@@ -1,17 +1,19 @@
 -- (c) 2007 Andy Gill
 
 -- Main driver for Hpc
-import HpcFlags
+import Data.Version
 import System.Environment
 import System.Exit
 import System.Console.GetOpt
 
+import HpcFlags
 import HpcReport
 import HpcMarkup
 import HpcCombine
 import HpcShowTix
 import HpcDraft
 import HpcOverlay
+import Paths_hpc_bin
 
 helpList :: IO ()
 helpList =
@@ -132,7 +134,7 @@ version_plugin = Plugin { name = "version"
 		   }
 
 version_main :: Flags -> [String] -> IO ()
-version_main _ _ = putStrLn $ "hpc tools, version 0.6"
+version_main _ _ = putStrLn ("hpc tools, version " ++ showVersion version)
 
 
 ------------------------------------------------------------------------------
diff --git a/utils/hpc/hpc-bin.cabal b/utils/hpc/hpc-bin.cabal
index 30b9621..76bac31 100644
--- a/utils/hpc/hpc-bin.cabal
+++ b/utils/hpc/hpc-bin.cabal
@@ -31,6 +31,7 @@ Executable hpc
                    HpcReport
                    HpcShowTix
                    HpcUtils
+                   Paths_hpc_bin
 
     if flag(base4)
         Build-Depends: base       >= 4   && < 5
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.