Update liner

This commit is contained in:
Jeremy Soller
2019-11-29 19:37:53 -07:00
parent 299d3ab37c
commit 2fd54ec8d4
14 changed files with 98 additions and 111 deletions
-2
View File
@@ -1,5 +1,3 @@
#![deny(warnings)]
#[macro_use]
extern crate clap;
extern crate redox_termios;
-2
View File
@@ -1,5 +1,3 @@
#![deny(warnings)]
#[macro_use]
extern crate clap;
extern crate extra;
-2
View File
@@ -1,5 +1,3 @@
#[deny(warnings)]
#[macro_use]
extern crate clap;
extern crate extra;
-2
View File
@@ -1,5 +1,3 @@
#[deny(warnings)]
#[macro_use]
extern crate clap;
extern crate extra;
-2
View File
@@ -1,5 +1,3 @@
#![deny(warnings)]
#[macro_use]
extern crate clap;
extern crate extra;
+6 -4
View File
@@ -1,5 +1,3 @@
#![deny(warnings)]
#[macro_use]
extern crate clap;
extern crate extra;
@@ -55,7 +53,11 @@ pub fn main() {
loop {
let user = liner::Context::new()
.read_line("\x1B[1mredox login:\x1B[0m ", &mut |_| {})
.read_line(
"\x1B[1mredox login:\x1B[0m ",
None,
&mut liner::BasicCompleter::new(Vec::<String>::new())
)
.try(&mut stderr);
if !user.is_empty() {
@@ -101,7 +103,7 @@ pub fn main() {
}
} else {
stdout.write(b"\n").try(&mut stderr);
stdout.flush().try(&mut stderr);;
stdout.flush().try(&mut stderr);
}
}
}
+3 -5
View File
@@ -1,5 +1,3 @@
#![deny(warnings)]
#[macro_use]
extern crate clap;
extern crate extra;
@@ -98,8 +96,8 @@ fn main() {
}
if verified {
stdout.write_all(b"new password: ").try(&mut stderr);;
stdout.flush().try(&mut stderr);;
stdout.write_all(b"new password: ").try(&mut stderr);
stdout.flush().try(&mut stderr);
if let Some(new_password) = stdin.read_passwd(&mut stdout).try(&mut stderr) {
stdout.write(b"\nconfirm password: ").try(&mut stderr);
@@ -107,7 +105,7 @@ fn main() {
if let Some(confirm_password) = stdin.read_passwd(&mut stdout).try(&mut stderr) {
stdout.write(b"\n").try(&mut stderr);
stdout.flush().try(&mut stderr);;
stdout.flush().try(&mut stderr);
if new_password == confirm_password {
user.set_passwd(&new_password).unwrap_or_exit(1);
-2
View File
@@ -1,5 +1,3 @@
#![deny(warnings)]
#[macro_use]
extern crate clap;
extern crate extra;
-2
View File
@@ -1,5 +1,3 @@
#![deny(warnings)]
extern crate extra;
extern crate syscall;
extern crate termion;
-2
View File
@@ -1,5 +1,3 @@
#![deny(warnings)]
#[macro_use]
extern crate clap;
extern crate extra;
-2
View File
@@ -1,5 +1,3 @@
#[deny(warnings)]
#[macro_use]
extern crate clap;
extern crate extra;
-2
View File
@@ -1,5 +1,3 @@
#![deny(warnings)]
#[macro_use]
extern crate clap;
extern crate extra;