fix for gcc 4.1.x
[ghc-hetmet.git] / glafp-utils / nofib-analyse / CmdLine.hs
index b32d8e5..6e920f8 100644 (file)
@@ -1,14 +1,14 @@
 -----------------------------------------------------------------------------
 -- CmdLine.hs
 
--- (c) Simon Marlow 1999
+-- (c) Simon Marlow 2005
 -----------------------------------------------------------------------------
 
 module CmdLine where
 
-import GetOpt
-import System
-import IOExts
+import System.Console.GetOpt
+import System.Environment      ( getArgs )
+import System.IO.Unsafe                ( unsafePerformIO )
 
 -----------------------------------------------------------------------------
 -- Command line arguments
@@ -25,12 +25,21 @@ 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
+  | OptLaTeXOutput
   | OptHTMLOutput
   | OptIgnoreSmallTimes Float
   | OptDeviations
   | OptNoDeviations
+  | OptTitle String
+  | OptColumns String
+  | OptRows String
   | OptHelp
   deriving Eq
 
@@ -46,7 +55,15 @@ argInfo =
        "Ignore runtimes smaller than <secs>"
   , Option ['d'] ["deviations"] (NoArg OptDeviations)
        "Display deviations (default)"
+  , Option ['l'] ["latex"]    (NoArg OptLaTeXOutput)  
+       "Produce LaTeX output"
+  , Option [] ["columns"] (ReqArg OptColumns "COLUMNS")
+       "Specify columns for summary table (comma separates)"
+  , Option [] ["rows"] (ReqArg OptRows "ROWS")
+       "Specify rows for summary table (comma separates)"
   , Option ['n'] ["nodeviations"] (NoArg OptNoDeviations)
        "Hide deviations"
+  , Option ['t'] ["title"] (ReqArg OptTitle "title")
+       "Specify report title"
   ]