Update liner

parent 299d3ab3
This diff is collapsed.
......@@ -53,7 +53,7 @@ path = "src/bin/usermod.rs"
[dependencies]
clap = "2.33.0"
extra = { git = "https://gitlab.redox-os.org/redox-os/libextra.git" }
liner = "0.4.4"
redox_liner = "0.5.1"
redox_syscall = "0.1.56"
redox_termios = "0.1.1"
redox_users = "0.3.1"
......
#![deny(warnings)]
#[macro_use]
extern crate clap;
extern crate redox_termios;
......
#![deny(warnings)]
#[macro_use]
extern crate clap;
extern crate extra;
......
#[deny(warnings)]
#[macro_use]
extern crate clap;
extern crate extra;
......
#[deny(warnings)]
#[macro_use]
extern crate clap;
extern crate extra;
......
#![deny(warnings)]
#[macro_use]
extern crate clap;
extern crate extra;
......
#![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);
}
}
}
#![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);
......
#![deny(warnings)]
#[macro_use]
extern crate clap;
extern crate extra;
......
#![deny(warnings)]
extern crate extra;
extern crate syscall;
extern crate termion;
......
#![deny(warnings)]
#[macro_use]
extern crate clap;
extern crate extra;
......
#[deny(warnings)]
#[macro_use]
extern crate clap;
extern crate extra;
......
#![deny(warnings)]
#[macro_use]
extern crate clap;
extern crate extra;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment