Permalink
Browse files

conf -b and bench for benchmark.

  • Loading branch information...
1 parent f0c8f0c commit afd8956b81d4b84a24eb004e15841f1e4c269e36 @kazu-yamamoto committed Dec 11, 2012
Showing with 19 additions and 2 deletions.
  1. +15 −2 CmdDB.hs
  2. +4 −0 Types.hs
View
@@ -64,7 +64,9 @@ commandDB = [
, routing = RouteCabal ["configure"]
, switches = [(SwSandbox, Just "--sandbox")
,(SwFlag, Just "--flags")
- ,(SwTest, Just "--enable-tests")]
+ ,(SwTest, Just "--enable-tests")
+ ,(SwBench, Just "--enable-benchmarks")
+ ]
, manual = Nothing
}
, CommandSpec {
@@ -196,6 +198,14 @@ commandDB = [
, switches = [(SwSandbox, Just "--sandbox")]
, manual = Nothing
}
+ , CommandSpec {
+ command = Bench
+ , commandNames = ["bench"]
+ , document = "Run benchmarks"
+ , routing = RouteCabal ["bench"]
+ , switches = [(SwSandbox, Just "--sandbox")]
+ , manual = Nothing
+ }
, CommandSpec {
command = Doc
, commandNames = ["doc", "haddock", "man"]
@@ -255,13 +265,16 @@ getOptDB = [
, Option ['t'] ["test"]
(NoArg OptTest)
"Enable test"
+ , Option ['b'] ["bench"]
+ (NoArg OptBench)
+ "Enable benchmark"
, Option ['h'] ["help"]
(NoArg OptHelp)
"Show help message"
]
optionDB :: OptionDB
-optionDB = zip [SwNoharm,SwRecursive,SwAll,SwInfo,SwSandbox,SwFlag,SwTest] getOptDB
+optionDB = zip [SwNoharm,SwRecursive,SwAll,SwInfo,SwSandbox,SwFlag,SwTest,SwBench] getOptDB
----------------------------------------------------------------
View
@@ -16,6 +16,7 @@ data Switch = SwNoharm
| SwSandbox
| SwFlag
| SwTest
+ | SwBench
deriving (Eq,Show)
data Option = OptNoharm
@@ -26,6 +27,7 @@ data Option = OptNoharm
| OptFlag String
| OptTest
| OptHelp
+ | OptBench
deriving (Eq,Show)
toSwitch :: Option -> Switch
@@ -36,6 +38,7 @@ toSwitch OptInfo = SwInfo
toSwitch (OptSandbox _) = SwSandbox
toSwitch (OptFlag _) = SwFlag
toSwitch OptTest = SwTest
+toSwitch OptBench = SwBench
toSwitch _ = error "toSwitch"
getSandbox :: [Option] -> Maybe FilePath
@@ -82,6 +85,7 @@ data Command = Sync
| Add
| Ghci
| Test
+ | Bench
| Doc
| Help
deriving (Eq,Show)

0 comments on commit afd8956

Please sign in to comment.