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

Commit

Permalink
Flush password prompt
Browse files Browse the repository at this point in the history
  • Loading branch information
arkpar committed May 2, 2016
1 parent cad08f7 commit bfac006
Showing 1 changed file with 6 additions and 0 deletions.
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

0 comments on commit bfac006

Please sign in to comment.