1 -----------------------------------------------------------------------------
4 -- (c) Simon Marlow 2005
5 -----------------------------------------------------------------------------
9 flags, other_args, cmdline_errors,
10 devs, nodevs, tooquick_threshold, reportTitle,
15 import System.Console.GetOpt
16 import System.Environment ( getArgs )
17 import System.IO.Unsafe ( unsafePerformIO )
19 -----------------------------------------------------------------------------
20 -- Command line arguments
22 args = unsafePerformIO getArgs
23 (flags, other_args, cmdline_errors) = getOpt Permute argInfo args
25 default_tooquick_threshold = 0.2 {- secs -} :: Float
27 = case [ i | OptIgnoreSmallTimes i <- flags ] of
28 [] -> default_tooquick_threshold
31 devs = OptDeviations `elem` flags
32 nodevs = OptNoDeviations `elem` flags
34 default_title = "NoFib Results"
35 reportTitle = case [ t | OptTitle t <- flags ] of
43 | OptIgnoreSmallTimes Float
53 usageHeader = "usage: nofib-analyse [OPTION...] <logfile1> <logfile2> ..."
56 usage = usageInfo usageHeader argInfo
58 argInfo :: [ OptDescr CLIFlags ]
60 [ Option ['?'] ["help"] (NoArg OptHelp)
61 "Display this message"
62 , Option ['a'] ["ascii"] (NoArg OptASCIIOutput)
63 "Produce ASCII output (default)"
64 , Option ['h'] ["html"] (NoArg OptHTMLOutput)
66 , Option ['i'] ["ignore"] (ReqArg (OptIgnoreSmallTimes . read) "secs")
67 "Ignore runtimes smaller than <secs>"
68 , Option ['d'] ["deviations"] (NoArg OptDeviations)
69 "Display deviations (default)"
70 , Option ['l'] ["latex"] (NoArg OptLaTeXOutput)
71 "Produce LaTeX output"
72 , Option [] ["columns"] (ReqArg OptColumns "COLUMNS")
73 "Specify columns for summary table (comma separates)"
74 , Option [] ["rows"] (ReqArg OptRows "ROWS")
75 "Specify rows for summary table (comma separates)"
76 , Option ['n'] ["nodeviations"] (NoArg OptNoDeviations)
78 , Option ['t'] ["title"] (ReqArg OptTitle "title")
79 "Specify report title"