Browse Source

admin: input password on the same line

ipv6
Denis Drakhnia 4 months ago
parent
commit
9d43ac5141
  1. 7
      admin/src/main.rs

7
admin/src/main.rs

@ -3,7 +3,7 @@ @@ -3,7 +3,7 @@
mod cli;
use std::io;
use std::io::{self, Write};
use std::net::UdpSocket;
use blake2b_simd::Params;
@ -24,7 +24,8 @@ fn read_password() -> Result<Option<String>, Error> { @@ -24,7 +24,8 @@ fn read_password() -> Result<Option<String>, Error> {
use crossterm::event::{read, Event, KeyCode, KeyEventKind, KeyModifiers};
use crossterm::terminal::{disable_raw_mode, enable_raw_mode};
println!("Password:");
print!("Password: ");
io::stdout().flush().unwrap();
enable_raw_mode()?;
@ -64,6 +65,8 @@ fn read_password() -> Result<Option<String>, Error> { @@ -64,6 +65,8 @@ fn read_password() -> Result<Option<String>, Error> {
disable_raw_mode()?;
println!();
Ok(match buf.len() {
0 => None,
_ => Some(buf),

Loading…
Cancel
Save