1 -----------------------------------------------------------------------------
4 -- (c) Simon Marlow 2005
5 -----------------------------------------------------------------------------
9 import System.Console.GetOpt
10 import System.Environment ( getArgs )
11 import System.IO.Unsafe ( unsafePerformIO )
13 -----------------------------------------------------------------------------
14 -- Command line arguments
16 args = unsafePerformIO getArgs
17 (flags, other_args, cmdline_errors) = getOpt Permute argInfo args
19 default_tooquick_threshold = 0.2 {- secs -} :: Float
21 = case [ i | OptIgnoreSmallTimes i <- flags ] of
22 [] -> default_tooquick_threshold
25 devs = OptDeviations `elem` flags
26 nodevs = OptNoDeviations `elem` flags
28 default_title = "NoFib Results"
29 reportTitle = case [ t | OptTitle t <- flags ] of
37 | OptIgnoreSmallTimes Float
46 argInfo :: [ OptDescr CLIFlags ]
48 [ Option ['?'] ["help"] (NoArg OptHelp)
49 "Display this message"
50 , Option ['a'] ["ascii"] (NoArg OptASCIIOutput)
51 "Produce ASCII output (default)"
52 , Option ['h'] ["html"] (NoArg OptHTMLOutput)
54 , Option ['i'] ["ignore"] (ReqArg (OptIgnoreSmallTimes . read) "secs")
55 "Ignore runtimes smaller than <secs>"
56 , Option ['d'] ["deviations"] (NoArg OptDeviations)
57 "Display deviations (default)"
58 , Option ['l'] ["latex"] (NoArg OptLaTeXOutput)
59 "Produce LaTeX output"
60 , Option [] ["columns"] (ReqArg OptColumns "COLUMNS")
61 "Specify columns for summary table (comma separates)"
62 , Option [] ["rows"] (ReqArg OptRows "ROWS")
63 "Specify rows for summary table (comma separates)"
64 , Option ['n'] ["nodeviations"] (NoArg OptNoDeviations)
66 , Option ['t'] ["title"] (ReqArg OptTitle "title")
67 "Specify report title"