aboutsummaryrefslogtreecommitdiff
path: root/src/format.nim
diff options
context:
space:
mode:
Diffstat (limited to 'src/format.nim')
-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: