wip
This commit is contained in:
parent
71004ef2b1
commit
a98a0ad567
1 changed files with 14 additions and 4 deletions
|
|
@ -34,12 +34,12 @@
|
||||||
[clojure.java.io :as io]
|
[clojure.java.io :as io]
|
||||||
[clojure.string :as str]
|
[clojure.string :as str]
|
||||||
[hf.depstar.uberjar :as uberjar]
|
[hf.depstar.uberjar :as uberjar]
|
||||||
|
[puget.printer :as puget]
|
||||||
[sci.addons :as addons]
|
[sci.addons :as addons]
|
||||||
[sci.core :as sci]
|
[sci.core :as sci]
|
||||||
[sci.impl.namespaces :as sci-namespaces]
|
[sci.impl.namespaces :as sci-namespaces]
|
||||||
[sci.impl.unrestrict :refer [*unrestricted*]]
|
[sci.impl.unrestrict :refer [*unrestricted*]]
|
||||||
[sci.impl.vars :as vars]
|
[sci.impl.vars :as vars])
|
||||||
[puget.printer :as puget])
|
|
||||||
(:gen-class))
|
(:gen-class))
|
||||||
|
|
||||||
(def windows?
|
(def windows?
|
||||||
|
|
@ -205,6 +205,16 @@
|
||||||
(let [options (next options)]
|
(let [options (next options)]
|
||||||
(recur (next options)
|
(recur (next options)
|
||||||
(assoc opts-map :main (first 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])
|
(if (some opts-map [:file :jar :socket-repl :expressions :main])
|
||||||
(assoc opts-map
|
(assoc opts-map
|
||||||
:command-line-args options)
|
:command-line-args options)
|
||||||
|
|
@ -475,7 +485,7 @@ If neither -e, -f, or --socket-repl are specified, then the first argument that
|
||||||
:repl :socket-repl :nrepl
|
:repl :socket-repl :nrepl
|
||||||
:verbose? :classpath
|
:verbose? :classpath
|
||||||
:main :uberscript :describe?
|
:main :uberscript :describe?
|
||||||
:jar :uberjar] :as _opts}
|
:jar :uberjar] :as cmd-line-opts}
|
||||||
(parse-opts args)
|
(parse-opts args)
|
||||||
_ (do ;; set properties
|
_ (do ;; set properties
|
||||||
(when main (System/setProperty "babashka.main" main))
|
(when main (System/setProperty "babashka.main" main))
|
||||||
|
|
@ -615,7 +625,7 @@ If neither -e, -f, or --socket-repl are specified, then the first argument that
|
||||||
:while (not (pipe-signal-received?))]
|
:while (not (pipe-signal-received?))]
|
||||||
(pr-f l))
|
(pr-f l))
|
||||||
(pr-f res))
|
(pr-f res))
|
||||||
(#_prn puget/cprint res)))) 0]]
|
((if (:puget cmd-line-opts) puget/cprint prn) res)))) 0]]
|
||||||
(if stream?
|
(if stream?
|
||||||
(recur)
|
(recur)
|
||||||
res)))))
|
res)))))
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue