liner
A Rust library offering readline-like functionality.
Basic Usage
In Cargo.toml
:
[]
= "0.1.1"
...
In src/main.rs
:
extern crate liner;
use Context;
License
MIT licensed. See the LICENSE
file.
A Rust library offering readline-like functionality.
In Cargo.toml
:
[dependencies]
liner = "0.1.1"
...
In src/main.rs
:
extern crate liner;
use liner::Context;
fn main() {
let mut con = Context::new();
loop {
let res = con.read_line("[prompt]$ ", &mut |_| {}).unwrap();
if res.is_empty() {
break;
}
con.history.push(res.into());
}
}
MIT licensed. See the LICENSE
file.