X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=utils%2Fhpc%2FHpc.hs;h=68fe87f98b8ecd026ec7e529d170eb90ee624f6d;hb=2e6bfe90491d5ab2ea58b4b1e60debd4738be643;hp=08a4285073bc097b66571b9ee1a1da8e4fb71f91;hpb=256ab58eb8f41086b3df819db52db29750de6f00;p=ghc-hetmet.git diff --git a/utils/hpc/Hpc.hs b/utils/hpc/Hpc.hs index 08a4285..68fe87f 100644 --- a/utils/hpc/Hpc.hs +++ b/utils/hpc/Hpc.hs @@ -1,6 +1,7 @@ -- (c) 2007 Andy Gill -- Main driver for Hpc +import Trace.Hpc.Tix import HpcFlags import System.Environment import System.Exit @@ -11,6 +12,7 @@ import HpcMarkup import HpcCombine import HpcShowTix import HpcDraft +import HpcOverlay helpList :: IO () helpList = @@ -26,7 +28,7 @@ helpList = help = ["help"] reporting = ["report","markup"] overlays = ["overlay","draft"] - processing = ["combine"] + processing = ["sum","combine","map"] other = [ name hook | hook <- hooks , name hook `notElem` @@ -48,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) @@ -62,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 @@ -74,8 +77,11 @@ main = do hooks = [ help_plugin , report_plugin , markup_plugin + , sum_plugin , combine_plugin + , map_plugin , showtix_plugin + , overlay_plugin , draft_plugin , version_plugin ] @@ -86,7 +92,7 @@ hooks' = [ (name hook,hook) | hook <- hooks ] help_plugin = Plugin { name = "help" , usage = "[]" - , summary = "Display help for hpc or a single command." + , summary = "Display help for hpc or a single command" , options = help_options , implementation = help_main , init_flags = default_flags @@ -105,20 +111,20 @@ 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 } -version_main _ _ = putStrLn $ "hpc tools, version 0.5-dev" +version_main _ _ = putStrLn $ "hpc tools, version 0.6" ------------------------------------------------------------------------------