Permalink
Browse files

Merge pull request #6 from jonathanjouty/master

Add GHCi option.
  • Loading branch information...
2 parents b8cc91d + 72278c2 commit a7b3d9dea2143c6fccb46f3a73c08474e84507af @kazu-yamamoto committed Jul 13, 2012
Showing with 19 additions and 1 deletion.
  1. +8 −0 CmdDB.hs
  2. +10 −1 Commands.hs
  3. +1 −0 Types.hs
View
@@ -205,6 +205,14 @@ commandDB = [
, manual = Nothing
}
, CommandSpec {
+ command = Ghci
+ , commandNames = ["ghci"]
+ , document = "Run GHCi within a sandbox"
+ , routing = RouteFunc ghci
+ , switches = [(SwSandbox, Just "--sandbox")]
+ , manual = Nothing
+ }
+ , CommandSpec {
command = Help
, commandNames = ["help"]
, document = "Display the help message of the command"
View
@@ -1,6 +1,6 @@
module Commands (
deps, revdeps, installed, outdated, uninstall, search, env
- , genpaths, check, add
+ , genpaths, check, add, ghci
) where
import Control.Applicative hiding (many)
@@ -194,3 +194,12 @@ add _ params opts = case getSandbox opts of
system $ "cabal-dev add-source " ++ src ++ " -s " ++ sbox
return ()
_ -> hPutStrLn stderr "A source path be specified."
+
+----------------------------------------------------------------
+
+ghci :: FunctionCommand
+ghci _ _ opts = case getSandbox opts of
+ Nothing -> hPutStrLn stderr "A sandbox must be specified with \"-s\" option."
+ Just sbox -> do
+ system $ "cabal-dev -s " ++ sbox ++ " ghci"
+ return ()
View
@@ -80,6 +80,7 @@ data Command = Sync
| Search
| Env
| Add
+ | Ghci
| Test
| Doc
| Help

0 comments on commit a7b3d9d

Please sign in to comment.