rl-sys 0.2.1

Native bindings to libreadline.
Documentation

readline-sys

Version

Crates.io Build Status

Native bindings to libreadline.

Features

  • thin wrappers around readline and add_history
  • write history line to file: add_history_persist
  • load history from file: preload_history

Usage

Add rl-sys as a dependency in Cargo.toml

[dependencies]
rl-sys = "0.2.0"

A simple implementation of echo using rl_sys::readline

extern crate rl_sys;

fn main() {
    let prompt = String::from("$ ");
    loop {
        let response = match rl_sys::readline(prompt) {
            Ok(s)  => s,
            Err(_) => break,
        };
        println!("{}", response);
    }
}

License

Distributed under the MIT License.