interaction 0.2.0

Interaction is a minimal and a simple readline library for Rust.
Documentation
interaction-0.2.0 has been yanked.

Interaction

Crates.io Crates.io

Interaction is a minimal and a simple readline library for Rust.

  • Single line editing mode
  • Multi line editing mode
  • Key bindings
  • History
  • Completion

Usage

Add this in your Cargo.toml:

[dependencies]
interaction = "0.2.0"

Or, if you installed cargo-edit, you run this command:

$ cargo add interaction

import interaction::Interaction.

use interaction::Interaction;

fn main() {
    let mut inter = Interaction::from_str(";;>");
    inter.set_completion(|_input, completions| {
        completions.push(b"foo");
        completions.push(b"bar");
    });
    loop {
        let input = inter.line().unwrap();
        // write any code.
    }
}