readline-sys

Version

Crates.io Build
Status

Native bindings to libreadline.

Features

API Documentation

Rustdocs

Usage

Add rl-sys as a dependency in Cargo.toml

toml [dependencies] rl-sys = "~0.4.1"

A simple implementation of cat using rl_sys::readline ```rust extern crate rl_sys;

use rlsys::readline; use rlsys::history::listmgmt;

fn main() { loop { let input: String = match readline::readline("") { Ok(Some(s)) => s, Ok(None) => break, // user entered ctrl-d Err(e) => { println!("{}", e); continue; } }; println!("{}", input);

    // Enables up/down arrow scrolling through history
    listmgmt::add(&input).unwrap();
}

} ```

Check out the more comprehensive shell example in the examples directory.

Development

To work on this crate, remember to git clone --recursive or git submodule init && git submodule update.

License

Distributed under the MIT License.