X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=utils%2Fhpc%2FHpc.hs;h=e22556efa333947da5f85f51cae843acd0fef106;hb=2924c4bc8e4a433c1816695d22319b63a328b418;hp=d567a0fad949b3e15d5c934f7b3b45d7303f332c;hpb=858a055da9f768dd20268cdddb3a3b7c904e83ef;p=ghc-hetmet.git diff --git a/utils/hpc/Hpc.hs b/utils/hpc/Hpc.hs index d567a0f..e22556e 100644 --- a/utils/hpc/Hpc.hs +++ b/utils/hpc/Hpc.hs @@ -10,6 +10,9 @@ import System.Console.GetOpt import HpcReport import HpcMarkup import HpcCombine +import HpcShowTix +import HpcDraft +import HpcOverlay helpList :: IO () helpList = @@ -18,16 +21,18 @@ helpList = section "Commands" help ++ section "Reporting Coverage" reporting ++ section "Processing Coverage files" processing ++ + section "Coverage Overlays" overlays ++ section "Others" other ++ "" where help = ["help"] reporting = ["report","markup"] + overlays = ["overlay","draft"] processing = ["combine"] other = [ name hook | hook <- hooks , name hook `notElem` - (concat [help,reporting,processing]) + (concat [help,reporting,processing,overlays]) ] section :: String -> [String] -> String @@ -45,11 +50,11 @@ dispatch [] = do exitWith ExitSuccess dispatch (txt:args) = do case lookup txt hooks' of - Just plugin -> parse plugin - _ -> parse help_plugin + Just plugin -> parse plugin args + _ -> parse help_plugin (txt:args) where - parse plugin = - case getOpt Permute (options plugin) args of + parse plugin args = + case getOpt Permute (options plugin []) args of (_,_,errs) | not (null errs) -> do putStrLn "hpc failed:" sequence [ putStr (" " ++ err) @@ -59,7 +64,8 @@ dispatch (txt:args) = do command_usage plugin exitFailure (o,ns,_) -> do - let flags = foldr (.) (final_flags plugin) o + let flags = final_flags plugin + $ foldr (.) id o $ init_flags plugin implementation plugin flags ns main = do @@ -72,6 +78,9 @@ hooks = [ help_plugin , report_plugin , markup_plugin , combine_plugin + , showtix_plugin + , overlay_plugin + , draft_plugin , version_plugin ] @@ -100,14 +109,14 @@ help_main flags (sub_txt:_) = do command_usage plugin' exitWith ExitSuccess -help_options = [] +help_options = id ------------------------------------------------------------------------------ version_plugin = Plugin { name = "version" , usage = "" , summary = "Display version for hpc" - , options = [] + , options = id , implementation = version_main , init_flags = default_flags , final_flags = default_final_flags @@ -116,4 +125,4 @@ version_plugin = Plugin { name = "version" version_main _ _ = putStrLn $ "hpc tools, version 0.5-dev" ------------------------------------------------------------------------------- +------------------------------------------------------------------------------ \ No newline at end of file