Skip to content

Commit

Permalink
add support for lein :connect [hostname:]port
Browse files Browse the repository at this point in the history
  • Loading branch information
cemerick committed Mar 15, 2012
1 parent 557cdde commit ee1f2d7
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/leiningen/repl.clj
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,11 @@ run outside of a project, it'll be standalone and the classpath will be
that of Leiningen.
USAGE: lein repl :headless
This will launch an nREPL server and wait, rather than connecting reply to it."
This will launch an nREPL server and wait, rather than connecting reply to it.
USAGE: lein repl :connect [host:]port
Connects to the nREPL server running at the given host (defaults to localhost)
and port."
([] (repl nil))
([project]
(nrepl.ack/reset-ack-port!)
Expand All @@ -69,12 +73,13 @@ This will launch an nREPL server and wait, rather than connecting reply to it."
{:attach (str repl-port)}
(:reply-options project)))
(println "REPL server launch timed out.")))
([project flag]
([project flag & opts]
(case flag
":headless" (do
(start-server project
(repl-port project)
(ack-port project))
(while true
(Thread/sleep Long/MAX_VALUE)))
":connect" (reply/launch-nrepl {:attach (first opts)})
(main/abort "Unrecognized flag:" flag))))

0 comments on commit ee1f2d7

Please sign in to comment.