Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Minor doc & error handling enhancements. #864

Merged
merged 2 commits into from

2 participants

@ghoseb
  • Don't throw an exception when the user doesn't mention the port number after :port
  • Add documentation about the new :port option
@michaelklishin michaelklishin merged commit f214cf8 into technomancy:master
@michaelklishin
Collaborator

Thank you!

@ghoseb

Thanks Michael!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Nov 26, 2012
  1. Handle malformed :port option gracefully.

    Baishampayan Ghose authored
This page is out of date. Refresh to see the latest.
Showing with 6 additions and 2 deletions.
  1. +6 −2 src/leiningen/repl.clj
View
8 src/leiningen/repl.clj
@@ -133,7 +133,10 @@
[opts]
(when-let [port (first
(for [[i o] (map-indexed vector opts) :when (= o ":port")]
- (nth opts (inc i))))]
+ (try
+ (nth opts (inc i))
+ (catch Exception _
+ nil))))]
(Integer. port)))
(defn ^:no-project-needed repl
@@ -148,8 +151,9 @@ inside of a project, it will be run in the context of that classpath.
If the command is run outside of a project, it'll be standalone and
the classpath will be that of Leiningen.
-USAGE: lein repl :headless
+USAGE: lein repl :headless [:port port]
This will launch an nREPL server and wait, rather than connecting reply to it.
+If :port is specified, the port given is used instead of a random one.
USAGE: lein repl :connect [host:]port
Connects to the nREPL server running at the given host (defaults to localhost)
Something went wrong with that request. Please try again.