Permalink
Browse files

"-t" option for "cab conf".

  • Loading branch information...
kazu-yamamoto committed Apr 18, 2012
1 parent 4107da5 commit b8cc91d7aa5d696c87d2aa822db36495af511e77
Showing with 12 additions and 6 deletions.
  1. +8 −4 CmdDB.hs
  2. +3 −0 Types.hs
  3. +0 −1 VerDB.hs
  4. +1 −1 cab.cabal
View
@@ -63,7 +63,8 @@ commandDB = [
, document = "Configure a cabal package"
, routing = RouteCabal ["configure"]
, switches = [(SwSandbox, Just "--sandbox")
- ,(SwFlag, Just "--flags")]
+ ,(SwFlag, Just "--flags")
+ ,(SwTest, Just "--enable-tests")]
, manual = Nothing
}
, CommandSpec {
@@ -190,15 +191,15 @@ commandDB = [
, CommandSpec {
command = Test
, commandNames = ["test"]
- , document = "run tests"
+ , document = "Run tests"
, routing = RouteCabal ["test"]
, switches = [(SwSandbox, Just "--sandbox")]
, manual = Nothing
}
, CommandSpec {
command = Doc
, commandNames = ["doc", "haddock", "man"]
- , document = "generate manuals"
+ , document = "Generate manuals"
, routing = RouteCabal ["haddock", "--hyperlink-source"]
, switches = []
, manual = Nothing
@@ -243,13 +244,16 @@ getOptDB = [
, Option ['f'] ["flags"]
(ReqArg OptFlag "<flags>")
"Specify flags"
+ , Option ['t'] ["test"]
+ (NoArg OptTest)
+ "Enable test"
, Option ['h'] ["help"]
(NoArg OptHelp)
"Show help message"
]
optionDB :: OptionDB
-optionDB = zip [SwNoharm,SwRecursive,SwAll,SwInfo,SwSandbox,SwFlag] getOptDB
+optionDB = zip [SwNoharm,SwRecursive,SwAll,SwInfo,SwSandbox,SwFlag,SwTest] getOptDB
----------------------------------------------------------------
View
@@ -15,6 +15,7 @@ data Switch = SwNoharm
| SwInfo
| SwSandbox
| SwFlag
+ | SwTest
deriving (Eq,Show)
data Option = OptNoharm
@@ -23,6 +24,7 @@ data Option = OptNoharm
| OptInfo
| OptSandbox String
| OptFlag String
+ | OptTest
| OptHelp
deriving (Eq,Show)
@@ -33,6 +35,7 @@ toSwitch OptAll = SwAll
toSwitch OptInfo = SwInfo
toSwitch (OptSandbox _) = SwSandbox
toSwitch (OptFlag _) = SwFlag
+toSwitch OptTest = SwTest
toSwitch _ = error "toSwitch"
getSandbox :: [Option] -> Maybe FilePath
View
@@ -7,7 +7,6 @@ module VerDB (
import Control.Applicative
import Control.Arrow (second)
import Data.Attoparsec.ByteString.Char8
-import Data.ByteString (ByteString)
import Data.Conduit
import Data.Conduit.Attoparsec
import Data.Conduit.Process
View
@@ -1,5 +1,5 @@
Name: cab
-Version: 0.1.12
+Version: 0.1.13
Author: Kazu Yamamoto <kazu@iij.ad.jp>
Maintainer: Kazu Yamamoto <kazu@iij.ad.jp>
License: BSD3

0 comments on commit b8cc91d

Please sign in to comment.