import HpcReport
import HpcMarkup
import HpcCombine
+import HpcShowTix
+import HpcDraft
+import HpcOverlay
helpList :: IO ()
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"]
- processing = ["combine"]
+ overlays = ["overlay","draft"]
+ processing = ["sum","combine","map"]
other = [ name hook
| hook <- hooks
, name hook `notElem`
- (concat [help,reporting,processing])
+ (concat [help,reporting,processing,overlays])
]
section :: String -> [String] -> String
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)
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
hooks = [ help_plugin
, report_plugin
, markup_plugin
+ , sum_plugin
, combine_plugin
+ , map_plugin
+ , showtix_plugin
+ , overlay_plugin
+ , draft_plugin
, version_plugin
]
help_plugin = Plugin { name = "help"
, usage = "[<HPC_COMMAND>]"
- , 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
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"
------------------------------------------------------------------------------