From 343579d4f32e91440b4b1d0c78bd3e918f74c51a Mon Sep 17 00:00:00 2001 From: kitsunyan Date: Mon, 2 Apr 2018 14:47:39 +0300 Subject: Write questions to stderr --- src/format.nim | 9 ++++++--- 1 file 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: -- cgit v1.2.3-70-g09d2