mirror of
https://github.com/janet-lang/janet
synced 2024-11-25 09:47:17 +00:00
The -q option no longer disables repl output.
This commit is contained in:
parent
ea1341a129
commit
9b5c6112e5
@ -2646,11 +2646,9 @@
|
|||||||
(if-not *quiet*
|
(if-not *quiet*
|
||||||
(print "Janet " janet/version "-" janet/build " Copyright (C) 2017-2020 Calvin Rose"))
|
(print "Janet " janet/version "-" janet/build " Copyright (C) 2017-2020 Calvin Rose"))
|
||||||
(flush)
|
(flush)
|
||||||
(defn noprompt [_] "")
|
|
||||||
(defn getprompt [p]
|
(defn getprompt [p]
|
||||||
(def [line] (parser/where p))
|
(def [line] (parser/where p))
|
||||||
(string "janet:" line ":" (parser/state p :delimiters) "> "))
|
(string "janet:" line ":" (parser/state p :delimiters) "> "))
|
||||||
(def prompter (if *quiet* noprompt getprompt))
|
|
||||||
(defn getstdin [prompt buf _]
|
(defn getstdin [prompt buf _]
|
||||||
(file/write stdout prompt)
|
(file/write stdout prompt)
|
||||||
(file/flush stdout)
|
(file/flush stdout)
|
||||||
@ -2659,7 +2657,7 @@
|
|||||||
(if *debug* (put env :debug true))
|
(if *debug* (put env :debug true))
|
||||||
(def getter (if *raw-stdin* getstdin getline))
|
(def getter (if *raw-stdin* getstdin getline))
|
||||||
(defn getchunk [buf p]
|
(defn getchunk [buf p]
|
||||||
(getter (prompter p) buf env))
|
(getter (getprompt p) buf env))
|
||||||
(def onsig (if *quiet* (fn [x &] x) nil))
|
(def onsig (if *quiet* (fn [x &] x) nil))
|
||||||
(setdyn :pretty-format (if *colorize* "%.20Q" "%.20q"))
|
(setdyn :pretty-format (if *colorize* "%.20Q" "%.20q"))
|
||||||
(setdyn :err-color (if *colorize* true))
|
(setdyn :err-color (if *colorize* true))
|
||||||
|
Loading…
Reference in New Issue
Block a user