Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #6 from jonathanjouty/master

Add GHCi option.
  • Loading branch information...
commit a7b3d9dea2143c6fccb46f3a73c08474e84507af 2 parents b8cc91d + 72278c2
@kazu-yamamoto authored
Showing with 19 additions and 1 deletion.
  1. +8 −0 CmdDB.hs
  2. +10 −1 Commands.hs
  3. +1 −0  Types.hs
View
8 CmdDB.hs
@@ -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
11 Commands.hs
@@ -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
1  Types.hs
@@ -80,6 +80,7 @@ data Command = Sync
| Search
| Env
| Add
+ | Ghci
| Test
| Doc
| Help
Please sign in to comment.
Something went wrong with that request. Please try again.