Warning Police: Unused imports
[ghc-hetmet.git] / utils / hpc / HpcFlags.hs
index 2cbe0c1..49ebb50 100644 (file)
@@ -3,10 +3,10 @@
 module HpcFlags where
 
 import System.Console.GetOpt
-import Data.Maybe ( fromMaybe )
 import qualified HpcSet as Set
 import Data.Char
 import Trace.Hpc.Tix
+import System.Exit
 
 data Flags = Flags 
   { outputFile         :: String
@@ -108,6 +108,12 @@ command_usage plugin =
                                        then ""
                                        else usageInfo "\n\nOptions:\n" (options plugin)
 
+hpcError :: Plugin -> String -> IO a
+hpcError plugin msg = do
+   putStrLn $ "Error: " ++ msg
+   command_usage plugin
+   exitFailure
 -------------------------------------------------------------------------------
 
 data Plugin = Plugin { name           :: String
@@ -140,8 +146,8 @@ allowModule flags full_mod
   where
       -- pkg name always ends with '/', main 
          (pkg_name,mod_name) = 
-                       case span (/= ':') full_mod of
-                    (p,':':m) -> (p ++ ":",m)
+                       case span (/= '/') full_mod of
+                    (p,'/':m) -> (p ++ ":",m)
                     (m,[])    -> (":",m)
                     _         -> error "impossible case in allowModule" 
 
@@ -149,6 +155,8 @@ filterTix :: Flags -> Tix -> Tix
 filterTix flags (Tix tixs) =
      Tix $ filter (allowModule flags . tixModuleName) tixs
 
+         
+
 ------------------------------------------------------------------------------
 -- HpcCombine specifics