Skip to content


Subversion checkout URL

You can clone with
Download ZIP


Minor doc & error handling enhancements. #864

merged 2 commits into from

2 participants

  • 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

Thank you!


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
8 src/leiningen/repl.clj
@@ -133,7 +133,10 @@
(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.