Commit 39f27370 authored by ian@well-typed.com's avatar ian@well-typed.com
Browse files

Add a --reset-hpcdirs flag to hpc

parent 95027b82
......@@ -1626,8 +1626,10 @@ Options:
--include=[PACKAGE:][MODULE] include MODULE and/or PACKAGE
--srcdir=DIR path to source directory of .hs files
multi-use of srcdir possible
--hpcdir=DIR sub-directory that contains .mix files
--hpcdir=DIR append sub-directory that contains .mix files
default .hpc [rarely used]
--reset-hpcdirs empty the list of hpcdir's
[rarely used]
--xml-output show output in XML
</screen>
</sect3>
......@@ -1644,8 +1646,10 @@ Options:
--include=[PACKAGE:][MODULE] include MODULE and/or PACKAGE
--srcdir=DIR path to source directory of .hs files
multi-use of srcdir possible
--hpcdir=DIR sub-directory that contains .mix files
--hpcdir=DIR append sub-directory that contains .mix files
default .hpc [rarely used]
--reset-hpcdirs empty the list of hpcdir's
[rarely used]
--fun-entry-count show top-level function entry counts
--highlight-covered highlight covered code, rather that code gaps
--destdir=DIR path to write output to
......@@ -1723,8 +1727,10 @@ Options:
--srcdir=DIR path to source directory of .hs files
multi-use of srcdir possible
--hpcdir=DIR sub-directory that contains .mix files
default .hpc [rarely used]
--hpcdir=DIR append sub-directory that contains .mix files
default .hpc [rarely used]
--reset-hpcdirs empty the list of hpcdir's
[rarely used]
--output=FILE output FILE
% hpc help draft
Usage: hpc draft [OPTION] .. &lt;TIX_FILE&gt;
......@@ -1735,8 +1741,10 @@ Options:
--include=[PACKAGE:][MODULE] include MODULE and/or PACKAGE
--srcdir=DIR path to source directory of .hs files
multi-use of srcdir possible
--hpcdir=DIR sub-directory that contains .mix files
--hpcdir=DIR append sub-directory that contains .mix files
default .hpc [rarely used]
--reset-hpcdirs empty the list of hpcdir's
[rarely used]
--output=FILE output FILE
</screen>
</sect3>
......
......@@ -18,6 +18,7 @@ draft_options
. includeOpt
. srcDirOpt
. hpcDirOpt
. resetHpcDirsOpt
. outputOpt
draft_plugin :: Plugin
......
......@@ -13,7 +13,7 @@ data Flags = Flags
{ outputFile :: String
, includeMods :: Set.Set String
, excludeMods :: Set.Set String
, hpcDir :: String
, hpcDirs :: [String]
, srcDirs :: [String]
, destDir :: String
......@@ -34,7 +34,7 @@ default_flags = Flags
{ outputFile = "-"
, includeMods = Set.empty
, excludeMods = Set.empty
, hpcDir = ".hpc"
, hpcDirs = [".hpc"]
, srcDirs = []
, destDir = "."
......@@ -72,7 +72,8 @@ anArg flag detail argtype fn = (:) $ Option [] [flag] (ReqArg fn argtype) detail
infoArg :: String -> FlagOptSeq
infoArg info = (:) $ Option [] [] (NoArg $ id) info
excludeOpt, includeOpt, hpcDirOpt, srcDirOpt, destDirOpt, outputOpt,
excludeOpt, includeOpt, hpcDirOpt, resetHpcDirsOpt, srcDirOpt,
destDirOpt, outputOpt,
perModuleOpt, decListOpt, xmlOutputOpt, funTotalsOpt,
altHighlightOpt, combineFunOpt, combineFunOptInfo, mapFunOpt,
mapFunOptInfo, unionModuleOpt :: FlagOptSeq
......@@ -82,10 +83,14 @@ excludeOpt = anArg "exclude" "exclude MODULE and/or PACKAGE" "[PACKAGE:]
includeOpt = anArg "include" "include MODULE and/or PACKAGE" "[PACKAGE:][MODULE]"
$ \ a f -> f { includeMods = a `Set.insert` includeMods f }
hpcDirOpt = anArg "hpcdir" "sub-directory that contains .mix files" "DIR"
(\ a f -> f { hpcDir = a })
hpcDirOpt = anArg "hpcdir" "append sub-directory that contains .mix files" "DIR"
(\ a f -> f { hpcDirs = hpcDirs f ++ [a] })
. infoArg "default .hpc [rarely used]"
resetHpcDirsOpt = noArg "reset-hpcdirs" "empty the list of hpcdir's"
(\ f -> f { hpcDirs = [] })
. infoArg "[rarely used]"
srcDirOpt = anArg "srcdir" "path to source directory of .hs files" "DIR"
(\ a f -> f { srcDirs = srcDirs f ++ [a] })
. infoArg "multi-use of srcdir possible"
......@@ -130,8 +135,9 @@ unionModuleOpt = noArg "union"
-------------------------------------------------------------------------------
readMixWithFlags :: Flags -> Either String TixModule -> IO Mix
readMixWithFlags flags modu = readMix [ dir ++ "/" ++ hpcDir flags
readMixWithFlags flags modu = readMix [ dir ++ "/" ++ hpcDir
| dir <- srcDirs flags
, hpcDir <- hpcDirs flags
] modu
-------------------------------------------------------------------------------
......
......@@ -29,6 +29,7 @@ markup_options
. includeOpt
. srcDirOpt
. hpcDirOpt
. resetHpcDirsOpt
. funTotalsOpt
. altHighlightOpt
. destDirOpt
......
......@@ -13,6 +13,7 @@ overlay_options :: FlagOptSeq
overlay_options
= srcDirOpt
. hpcDirOpt
. resetHpcDirsOpt
. outputOpt
overlay_plugin :: Plugin
......
......@@ -272,6 +272,7 @@ report_options
. includeOpt
. srcDirOpt
. hpcDirOpt
. resetHpcDirsOpt
. xmlOutputOpt
......@@ -13,6 +13,7 @@ showtix_options
. includeOpt
. srcDirOpt
. hpcDirOpt
. resetHpcDirsOpt
. outputOpt
showtix_plugin :: Plugin
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment