diff options
author | scgilardi <scgilardi@gmail.com> | 2009-01-04 17:35:45 +0000 |
---|---|---|
committer | scgilardi <scgilardi@gmail.com> | 2009-01-04 17:35:45 +0000 |
commit | 44e7945c140938338408462aeab71f67d5fdceb9 (patch) | |
tree | fdc27e9294d58fc2618419f8715c9e46f3799310 /src/clojure/contrib/repl_ln.clj | |
parent | 66b47eebd17ddd1caa3601eb1af829e6fdb128df (diff) |
repl_ln: support an optional --repl or -r command line arg before other args
Diffstat (limited to 'src/clojure/contrib/repl_ln.clj')
-rw-r--r-- | src/clojure/contrib/repl_ln.clj | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/clojure/contrib/repl_ln.clj b/src/clojure/contrib/repl_ln.clj index 8041f515..8ef4c867 100644 --- a/src/clojure/contrib/repl_ln.clj +++ b/src/clojure/contrib/repl_ln.clj @@ -89,14 +89,22 @@ -i filepath, or --init filepath - by loading the referenced files. Returns a seq of the remaining args." + by loading the referenced files, then accepts an optional terminating arg + of the form: + + -r, or + --repl + + Returns a seq of any remaining args." [args] (loop [[init filename & more :as args] args] (if (#{"-i" "--init"} init) (do (clojure.main/load-script filename) (recur more)) - args))) + (if (#{"-r" "--repl"} init) + (rest args) + args)))) (defn- process-command-line "Args are strings passed in from the command line. Loads any requested |