X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=utils%2Fnofib-analyse%2FCmdLine.hs;h=8b606261fc1955d7d29c183520c58d2a59025657;hb=bd15be885462a30763c92a3613c630d8c0a3f0cc;hp=5be7d324b0f1eab3feb165f6ee680675ad81dd59;hpb=2b80dae352da3a5a65a05d213b19adeb6baddf48;p=ghc-hetmet.git diff --git a/utils/nofib-analyse/CmdLine.hs b/utils/nofib-analyse/CmdLine.hs index 5be7d32..8b60626 100644 --- a/utils/nofib-analyse/CmdLine.hs +++ b/utils/nofib-analyse/CmdLine.hs @@ -19,18 +19,26 @@ import System.IO.Unsafe ( unsafePerformIO ) ----------------------------------------------------------------------------- -- Command line arguments +args :: [String] args = unsafePerformIO getArgs + +flags :: [CLIFlags] +other_args :: [String] +cmdline_errors :: [String] (flags, other_args, cmdline_errors) = getOpt Permute argInfo args -default_tooquick_threshold = 0.2 {- secs -} :: Float +default_tooquick_threshold, tooquick_threshold :: Float +default_tooquick_threshold = 0.2 {- secs -} tooquick_threshold = case [ i | OptIgnoreSmallTimes i <- flags ] of [] -> default_tooquick_threshold (i:_) -> i +devs, nodevs :: Bool devs = OptDeviations `elem` flags nodevs = OptNoDeviations `elem` flags +default_title, reportTitle :: String default_title = "NoFib Results" reportTitle = case [ t | OptTitle t <- flags ] of [] -> default_title @@ -38,7 +46,7 @@ reportTitle = case [ t | OptTitle t <- flags ] of data CLIFlags = OptASCIIOutput - | OptLaTeXOutput + | OptLaTeXOutput (Maybe String) | OptHTMLOutput | OptIgnoreSmallTimes Float | OptDeviations @@ -46,6 +54,8 @@ data CLIFlags | OptTitle String | OptColumns String | OptRows String + | OptCSV String + | OptNormalise String | OptHelp deriving Eq @@ -67,12 +77,16 @@ argInfo = "Ignore runtimes smaller than " , Option ['d'] ["deviations"] (NoArg OptDeviations) "Display deviations (default)" - , Option ['l'] ["latex"] (NoArg OptLaTeXOutput) + , Option ['l'] ["latex"] (OptArg OptLaTeXOutput "TABLE") "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 [] ["csv"] (ReqArg OptCSV "TABLE") + "Output a single table in CSV format" + , Option [] ["normalise"] (ReqArg OptNormalise "percent|ratio|none") + "normalise to the baseline" , Option ['n'] ["nodeviations"] (NoArg OptNoDeviations) "Hide deviations" , Option ['t'] ["title"] (ReqArg OptTitle "title")