Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Add GHCi option. #6

Merged
merged 1 commit into from

2 participants

@jonathanjouty

You may not want this but just thought it was really easy to do, so feel free to ignore it!

Loads up ghci with sandbox, useful when using CAB_SANDBOX_PATH.
Simply a wrapper to cabal-dev.

@jonathanjouty jonathanjouty Added ghci command line option.
Loads up ghci with sandbox, useful when using CAB_SANDBOX_PATH.
Simply a wrapper to cabal-dev.
72278c2
@kazu-yamamoto kazu-yamamoto merged commit a7b3d9d into kazu-yamamoto:master
@kazu-yamamoto

This has no harm to me. Let's merge it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jul 12, 2012
  1. @jonathanjouty

    Added ghci command line option.

    jonathanjouty authored
    Loads up ghci with sandbox, useful when using CAB_SANDBOX_PATH.
    Simply a wrapper to cabal-dev.
This page is out of date. Refresh to see the latest.
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
Something went wrong with that request. Please try again.