summaryrefslogtreecommitdiff
path: root/glafp-utils
diff options
context:
space:
mode:
authorkeithw <unknown>2000-07-05 15:42:19 +0000
committerkeithw <unknown>2000-07-05 15:42:19 +0000
commit8d5bf65c745546ce36fad5e09bfd94f38cd62119 (patch)
tree5d2fff4cbcc7f2266aef17169dc3190712d56d3e /glafp-utils
parentdfedfb0289ca2de4bb51330bfd7d51fa975da2c3 (diff)
downloadhaskell-8d5bf65c745546ce36fad5e09bfd94f38cd62119.tar.gz
[project @ 2000-07-05 15:42:19 by keithw]
Add -t flag to specify title of report.
Diffstat (limited to 'glafp-utils')
-rw-r--r--glafp-utils/nofib-analyse/CmdLine.hs8
-rw-r--r--glafp-utils/nofib-analyse/Main.hs11
2 files changed, 15 insertions, 4 deletions
diff --git a/glafp-utils/nofib-analyse/CmdLine.hs b/glafp-utils/nofib-analyse/CmdLine.hs
index b32d8e5cb8..c16d7860bc 100644
--- a/glafp-utils/nofib-analyse/CmdLine.hs
+++ b/glafp-utils/nofib-analyse/CmdLine.hs
@@ -25,12 +25,18 @@ tooquick_threshold
devs = OptDeviations `elem` flags
nodevs = OptNoDeviations `elem` flags
+default_title = "NoFib Results"
+reportTitle = case [ t | OptTitle t <- flags ] of
+ [] -> default_title
+ (t:_) -> t
+
data CLIFlags
= OptASCIIOutput
| OptHTMLOutput
| OptIgnoreSmallTimes Float
| OptDeviations
| OptNoDeviations
+ | OptTitle String
| OptHelp
deriving Eq
@@ -48,5 +54,7 @@ argInfo =
"Display deviations (default)"
, Option ['n'] ["nodeviations"] (NoArg OptNoDeviations)
"Hide deviations"
+ , Option ['t'] ["title"] (ReqArg OptTitle "title")
+ "Specify report title"
]
diff --git a/glafp-utils/nofib-analyse/Main.hs b/glafp-utils/nofib-analyse/Main.hs
index 299b6f81d0..91cdfd10e7 100644
--- a/glafp-utils/nofib-analyse/Main.hs
+++ b/glafp-utils/nofib-analyse/Main.hs
@@ -1,5 +1,5 @@
-----------------------------------------------------------------------------
--- $Id: Main.hs,v 1.3 2000/03/02 11:39:45 keithw Exp $
+-- $Id: Main.hs,v 1.4 2000/07/05 15:42:19 keithw Exp $
-- (c) Simon Marlow 1997-1999
-----------------------------------------------------------------------------
@@ -113,8 +113,9 @@ time_ok t = t > tooquick_threshold
-- HTML page generation
htmlPage results args
- = header [] (theTitle [] (htmlStr "NoFib Results"))
+ = header [] (theTitle [] (htmlStr reportTitle))
+++ bar []
+ +++ h1 [] (htmlStr reportTitle)
+++ gen_menu
+++ bar []
+++ body [] (gen_tables results args)
@@ -131,7 +132,7 @@ gen_tables results args =
+++ foldr1 (+++) (map (htmlGenModTable results args) per_module_result_tab)
htmlGenProgTable results args (SpecP title anc get_result get_status result_ok)
- = sectHeading title anc
+ = sectHeading title anc
+++ font [size 1] (
mkTable (htmlShowResults results args get_result get_status result_ok))
+++ bar []
@@ -279,7 +280,9 @@ hexDig i | i > 10 = chr (i-10 + ord 'a')
-- ASCII page generation
asciiPage results args =
- ( interleave "\n\n" (map (asciiGenProgTable results args) per_prog_result_tab)
+ ( str reportTitle
+ . str "\n\n"
+ . interleave "\n\n" (map (asciiGenProgTable results args) per_prog_result_tab)
. str "\n"
. interleave "\n\n" (map (asciiGenModTable results args) per_module_result_tab)
) "\n"