client: use stderr for all fingerprint confirm msgs

an interactive client might still want machine-readable output on
stdout.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
This commit is contained in:
Fabian Grünbichler 2021-05-10 10:52:34 +02:00 committed by Thomas Lamprecht
parent 065013ccec
commit 85f4e834d8

View File

@ -516,9 +516,9 @@ impl HttpClient {
// If we're on a TTY, query the user // If we're on a TTY, query the user
if interactive && tty::stdin_isatty() { if interactive && tty::stdin_isatty() {
println!("fingerprint: {}", fp_string); eprintln!("fingerprint: {}", fp_string);
loop { loop {
print!("Are you sure you want to continue connecting? (y/n): "); eprint!("Are you sure you want to continue connecting? (y/n): ");
let _ = std::io::stdout().flush(); let _ = std::io::stdout().flush();
use std::io::{BufRead, BufReader}; use std::io::{BufRead, BufReader};
let mut line = String::new(); let mut line = String::new();