projects
/
ghc-hetmet.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
ext-core library: Change syntax for primitive coercions
[ghc-hetmet.git]
/
utils
/
nofib-analyse
/
CmdLine.hs
diff --git
a/utils/nofib-analyse/CmdLine.hs
b/utils/nofib-analyse/CmdLine.hs
index
6e920f8
..
0a303e1
100644
(file)
--- a/
utils/nofib-analyse/CmdLine.hs
+++ b/
utils/nofib-analyse/CmdLine.hs
@@
-4,7
+4,13
@@
-- (c) Simon Marlow 2005
-----------------------------------------------------------------------------
-- (c) Simon Marlow 2005
-----------------------------------------------------------------------------
-module CmdLine where
+module CmdLine
+ (
+ flags, other_args, cmdline_errors,
+ devs, nodevs, tooquick_threshold, reportTitle,
+ CLIFlags(..), usage,
+ )
+ where
import System.Console.GetOpt
import System.Environment ( getArgs )
import System.Console.GetOpt
import System.Environment ( getArgs )
@@
-13,18
+19,26
@@
import System.IO.Unsafe ( unsafePerformIO )
-----------------------------------------------------------------------------
-- Command line arguments
-----------------------------------------------------------------------------
-- Command line arguments
+args :: [String]
args = unsafePerformIO getArgs
args = unsafePerformIO getArgs
+
+flags :: [CLIFlags]
+other_args :: [String]
+cmdline_errors :: [String]
(flags, other_args, cmdline_errors) = getOpt Permute argInfo args
(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
tooquick_threshold
= case [ i | OptIgnoreSmallTimes i <- flags ] of
[] -> default_tooquick_threshold
(i:_) -> i
+devs, nodevs :: Bool
devs = OptDeviations `elem` flags
nodevs = OptNoDeviations `elem` flags
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
default_title = "NoFib Results"
reportTitle = case [ t | OptTitle t <- flags ] of
[] -> default_title
@@
-40,9
+54,17
@@
data CLIFlags
| OptTitle String
| OptColumns String
| OptRows String
| OptTitle String
| OptColumns String
| OptRows String
+ | OptCSV String
+ | OptNoNormalise
| OptHelp
deriving Eq
| OptHelp
deriving Eq
+usageHeader :: String
+usageHeader = "usage: nofib-analyse [OPTION...] <logfile1> <logfile2> ..."
+
+usage :: String
+usage = usageInfo usageHeader argInfo
+
argInfo :: [ OptDescr CLIFlags ]
argInfo =
[ Option ['?'] ["help"] (NoArg OptHelp)
argInfo :: [ OptDescr CLIFlags ]
argInfo =
[ Option ['?'] ["help"] (NoArg OptHelp)
@@
-61,6
+83,10
@@
argInfo =
"Specify columns for summary table (comma separates)"
, Option [] ["rows"] (ReqArg OptRows "ROWS")
"Specify rows for summary table (comma separates)"
"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 [] ["no-normalise"] (NoArg OptNoNormalise)
+ "Do not normalise to the baseline"
, Option ['n'] ["nodeviations"] (NoArg OptNoDeviations)
"Hide deviations"
, Option ['t'] ["title"] (ReqArg OptTitle "title")
, Option ['n'] ["nodeviations"] (NoArg OptNoDeviations)
"Hide deviations"
, Option ['t'] ["title"] (ReqArg OptTitle "title")