rl-sys 0.3.0

Native bindings to libreadline.
docs.rs failed to build rl-sys-0.3.0
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Visit the last successful build: rl-sys-0.5.2

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
  • library version: version

API Documentation

Rustdocs

Usage

Add rl-sys as a dependency in Cargo.toml

[dependencies]
rl-sys = "~0.3.0"

A simple implementation of echo using rl_sys::readline

extern crate rl_sys;

fn main() {
    loop {
        let response = match rl_sys::readline("$ ") {
            Ok(o) => match o {
                Some(s) => s,
                None    => break,
            },
            None    => break,
        };
        println!("{}", response);
    }
}

License

Distributed under the MIT License.