aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkitsunyan2018-04-02 11:47:39 +0000
committerkitsunyan2018-04-02 11:47:39 +0000
commit343579d4f32e91440b4b1d0c78bd3e918f74c51a (patch)
tree269b2693fac4db0ba0035f20e510124145e1d662
parent545e6257b45c8808cdbce271e65cdc171337c320 (diff)
Write questions to stderr
-rw-r--r--src/format.nim9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/format.nim b/src/format.nim
index 9255985..b1659fc 100644
--- a/src/format.nim
+++ b/src/format.nim
@@ -222,10 +222,13 @@ proc printColon*(color: bool, s: string) =
proc printColonUserInput*(color: bool, s: string,
noconfirm: bool, default: string, cancel: string): string =
- stdout.write(^Color.blue, ":: ", ^Color.bold, s, ^Color.normal, " ")
- stdout.flushFile()
+ # pacman writes questions to stderr unless noconfirm specified
+ let stream = if noconfirm: stdout else: stderr
+ stream.write(^Color.blue, ":: ", ^Color.bold, s, ^Color.normal, " ")
+ stream.flushFile()
if noconfirm:
- echo()
+ stream.write("\n")
+ stream.flushFile()
default
else:
try: