The goal is to offer a similar set of functionality as pexpect.
Basic usage
Add this to your Cargo.toml
[]
= "0.1"
Simple example for interacting via ftp:
extern crate rexpect;
use spawn;
use *;
Example with bash
extern crate rexpect;
use spawn_bash;
use *;
Project Status
What already works:
- spawning a processes through pty (threadsafe!), auto cleanup (killing all child processes)
- expect regex/string/EOF including timeouts
- spawning bash, interacting with ctrl-z, bg etc
What does not yet work:
- other repls as python are not implemented yet
- getting specific output (e.g. matching with regex and fetching the match) is missing
What will probably never be implemented
- screen/ANSI support (deprecated in pexpect anyway)
Design decisions
- use error handling of error-chain
- use nix (and avoid libc wherever possible) to keep the code safe and clean
- sadly,
expect
is used in rust too prominently to unwrapOption
s andResult
s, useexp_*
instead