import Control.Monad
import qualified HpcSet as Set
import qualified HpcMap as Map
-import System.Environment
------------------------------------------------------------------------------
+sum_options :: FlagOptSeq
sum_options
= excludeOpt
. includeOpt
. outputOpt
. unionModuleOpt
+sum_plugin :: Plugin
sum_plugin = Plugin { name = "sum"
, usage = "[OPTION] .. <TIX_FILE> [<TIX_FILE> [<TIX_FILE> ..]]"
, options = sum_options
, final_flags = default_final_flags
}
+combine_options :: FlagOptSeq
combine_options
= excludeOpt
. includeOpt
. combineFunOptInfo
. unionModuleOpt
+combine_plugin :: Plugin
combine_plugin = Plugin { name = "combine"
, usage = "[OPTION] .. <TIX_FILE> <TIX_FILE>"
, options = combine_options
, final_flags = default_final_flags
}
+map_options :: FlagOptSeq
map_options
= excludeOpt
. includeOpt
. mapFunOptInfo
. unionModuleOpt
+map_plugin :: Plugin
map_plugin = Plugin { name = "map"
, usage = "[OPTION] .. <TIX_FILE> "
, options = map_options
------------------------------------------------------------------------------
sum_main :: Flags -> [String] -> IO ()
-sum_main flags [] = hpcError sum_plugin $ "no .tix file specified"
+sum_main _ [] = hpcError sum_plugin $ "no .tix file specified"
sum_main flags (first_file:more_files) = do
Just tix <- readTix first_file
case outputFile flags of
"-" -> putStrLn (show tix)
out -> writeTix out tix
-combine_main flags [] = hpcError sum_plugin $ "need exactly two .tix files to combine"
+combine_main _ _ = hpcError combine_plugin $ "need exactly two .tix files to combine"
map_main :: Flags -> [String] -> IO ()
map_main flags [first_file] = do
case outputFile flags of
"-" -> putStrLn (show tix')
out -> writeTix out tix'
-map_main flags [] = hpcError sum_plugin $ "no .tix file specified"
-map_main flags _ = hpcError sum_plugin $ "to many .tix files specified"
+map_main _ [] = hpcError map_plugin $ "no .tix file specified"
+map_main _ _ = hpcError map_plugin $ "to many .tix files specified"
mergeTixFile :: Flags -> (Integer -> Integer -> Integer) -> Tix -> String -> IO Tix
mergeTixFile flags fn tix file_name = do