Skip to content
This repository has been archived by the owner on Nov 6, 2020. It is now read-only.

Flush password prompt #1031

Merged
merged 1 commit into from
May 2, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 6 additions & 0 deletions parity/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -207,15 +207,21 @@ fn execute_client(conf: Configuration) {
wait_for_exit(panic_handler, rpc_server, webapp_server);
}

fn flush_stdout() {
::std::io::stdout().flush().ok().expect("stdout is flushable; qed");
}

fn execute_account_cli(conf: Configuration) {
use util::keys::store::SecretStore;
use rpassword::read_password;
let mut secret_store = SecretStore::new_in(Path::new(&conf.keys_path()));
if conf.args.cmd_new {
println!("Please note that password is NOT RECOVERABLE.");
print!("Type password: ");
flush_stdout();
let password = read_password().unwrap();
print!("Repeat password: ");
flush_stdout();
let password_repeat = read_password().unwrap();
if password != password_repeat {
println!("Passwords do not match!");
Expand Down