Compare commits

...

2 commits

Author SHA1 Message Date
Michiel Borkent
a98a0ad567 wip 2020-10-22 16:54:50 +02:00
Michiel Borkent
71004ef2b1 wip 2020-10-22 13:15:02 +02:00
3 changed files with 17 additions and 4 deletions

View file

@ -26,7 +26,8 @@
datascript/datascript {:mvn/version "1.0.1"}
http-kit/http-kit {:mvn/version "2.5.0"}
babashka/clojure-lanterna {:mvn/version "0.9.8-SNAPSHOT"}
org.clojure/math.combinatorics {:mvn/version "0.1.6"}}
org.clojure/math.combinatorics {:mvn/version "0.1.6"}
mvxcvi/puget {:mvn/version "1.3.1"}}
:aliases {:main
{:main-opts ["-m" "babashka.main"]}
:profile

View file

@ -21,7 +21,8 @@
[cheshire "5.10.0"]
[nrepl/bencode "1.1.0"]
[borkdude/sci.impl.reflector "0.0.1-java11"]
[org.clojure/math.combinatorics "0.1.6"]]
[org.clojure/math.combinatorics "0.1.6"]
[mvxcvi/puget "1.3.1"]]
:profiles {:feature/xml {:source-paths ["feature-xml"]
:dependencies [[org.clojure/data.xml "0.2.0-alpha6"]]}
:feature/yaml {:source-paths ["feature-yaml"]

View file

@ -34,6 +34,7 @@
[clojure.java.io :as io]
[clojure.string :as str]
[hf.depstar.uberjar :as uberjar]
[puget.printer :as puget]
[sci.addons :as addons]
[sci.core :as sci]
[sci.impl.namespaces :as sci-namespaces]
@ -204,6 +205,16 @@
(let [options (next options)]
(recur (next options)
(assoc opts-map :main (first options))))
"--puget"
(let [options (next options)
opt (first options)
opt (when (and opt (not (str/starts-with? opt "-")))
opt)
options (if opt (next options)
options)]
(recur options
(assoc opts-map
:puget (or opt true))))
(if (some opts-map [:file :jar :socket-repl :expressions :main])
(assoc opts-map
:command-line-args options)
@ -474,7 +485,7 @@ If neither -e, -f, or --socket-repl are specified, then the first argument that
:repl :socket-repl :nrepl
:verbose? :classpath
:main :uberscript :describe?
:jar :uberjar] :as _opts}
:jar :uberjar] :as cmd-line-opts}
(parse-opts args)
_ (do ;; set properties
(when main (System/setProperty "babashka.main" main))
@ -614,7 +625,7 @@ If neither -e, -f, or --socket-repl are specified, then the first argument that
:while (not (pipe-signal-received?))]
(pr-f l))
(pr-f res))
(prn res)))) 0]]
((if (:puget cmd-line-opts) puget/cprint prn) res)))) 0]]
(if stream?
(recur)
res)))))