From d0a84d791574962993778160665ce6bc10c7eb43 Mon Sep 17 00:00:00 2001 From: Paul Lietar Date: Thu, 5 Jan 2017 14:24:22 +0100 Subject: [PATCH] Print password prompt on stderr. --- src/main_helper.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main_helper.rs b/src/main_helper.rs index 8fac09f6..43c9d50d 100644 --- a/src/main_helper.rs +++ b/src/main_helper.rs @@ -1,6 +1,6 @@ use getopts; use rpassword; -use std::io::{stdout, Write}; +use std::io::{stderr, Write}; use std::path::PathBuf; use std::process::exit; @@ -107,8 +107,8 @@ pub fn get_credentials(session: &Session, matches: &getopts::Matches) -> Credent => credentials.clone(), (Some(username), None, _) => { - print!("Password for {}: ", username); - stdout().flush().unwrap(); + write!(stderr(), "Password for {}: ", username).unwrap(); + stderr().flush().unwrap(); let password = rpassword::read_password().unwrap(); Credentials::with_password(username.clone(), password) }