1
0
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:
Calvin Rose 2020-04-20 19:28:30 -05:00
parent ea1341a129
commit 9b5c6112e5

View File

@ -2646,11 +2646,9 @@
(if-not *quiet*
(print "Janet " janet/version "-" janet/build " Copyright (C) 2017-2020 Calvin Rose"))
(flush)
(defn noprompt [_] "")
(defn getprompt [p]
(def [line] (parser/where p))
(string "janet:" line ":" (parser/state p :delimiters) "> "))
(def prompter (if *quiet* noprompt getprompt))
(defn getstdin [prompt buf _]
(file/write stdout prompt)
(file/flush stdout)
@ -2659,7 +2657,7 @@
(if *debug* (put env :debug true))
(def getter (if *raw-stdin* getstdin getline))
(defn getchunk [buf p]
(getter (prompter p) buf env))
(getter (getprompt p) buf env))
(def onsig (if *quiet* (fn [x &] x) nil))
(setdyn :pretty-format (if *colorize* "%.20Q" "%.20q"))
(setdyn :err-color (if *colorize* true))