make *command-line-args* available to REPL
This commit is contained in:
parent
7853d69474
commit
a02d775fc8
2 changed files with 9 additions and 3 deletions
|
|
@ -1021,7 +1021,8 @@ Use bb run --help to show this help output.
|
||||||
doc (print-doc sci-ctx command-line-args)
|
doc (print-doc sci-ctx command-line-args)
|
||||||
describe?
|
describe?
|
||||||
[(print-describe) 0]
|
[(print-describe) 0]
|
||||||
repl [(repl/start-repl! sci-ctx) 0]
|
repl (sci/binding [core/command-line-args command-line-args]
|
||||||
|
[(repl/start-repl! sci-ctx) 0])
|
||||||
nrepl [(start-nrepl! nrepl) 0]
|
nrepl [(start-nrepl! nrepl) 0]
|
||||||
uberjar [nil 0]
|
uberjar [nil 0]
|
||||||
list-tasks [(tasks/list-tasks sci-ctx) 0]
|
list-tasks [(tasks/list-tasks sci-ctx) 0]
|
||||||
|
|
@ -1069,7 +1070,8 @@ Use bb run --help to show this help output.
|
||||||
clojure [nil (if-let [proc (bdeps/clojure command-line-args)]
|
clojure [nil (if-let [proc (bdeps/clojure command-line-args)]
|
||||||
(-> @proc :exit)
|
(-> @proc :exit)
|
||||||
0)]
|
0)]
|
||||||
:else [(repl/start-repl! sci-ctx) 0]))
|
:else (sci/binding [core/command-line-args command-line-args]
|
||||||
|
[(repl/start-repl! sci-ctx) 0])))
|
||||||
1)]
|
1)]
|
||||||
(flush)
|
(flush)
|
||||||
(when uberscript
|
(when uberscript
|
||||||
|
|
|
||||||
|
|
@ -480,7 +480,11 @@
|
||||||
|
|
||||||
(deftest command-line-args-test
|
(deftest command-line-args-test
|
||||||
(is (true? (bb nil "(nil? *command-line-args*)")))
|
(is (true? (bb nil "(nil? *command-line-args*)")))
|
||||||
(is (= ["1" "2" "3"] (bb nil "*command-line-args*" "1" "2" "3"))))
|
(is (= ["1" "2" "3"] (bb nil "*command-line-args*" "1" "2" "3")))
|
||||||
|
(is (str/includes? (test-utils/bb "*command-line-args*" "repl" "--" "1" "2" "3")
|
||||||
|
"(\"1\" \"2\" \"3\""))
|
||||||
|
(is (str/includes? (test-utils/bb "*command-line-args*" "--" "1" "2" "3")
|
||||||
|
"(\"1\" \"2\" \"3\"")))
|
||||||
|
|
||||||
(deftest constructors-test
|
(deftest constructors-test
|
||||||
(testing "the clojure.lang.Delay constructor works"
|
(testing "the clojure.lang.Delay constructor works"
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue