File tree Expand file tree Collapse file tree 1 file changed +4
-16
lines changed
Expand file tree Collapse file tree 1 file changed +4
-16
lines changed Original file line number Diff line number Diff line change 1515//! # Basic example
1616//!
1717//! ```no_run
18- //!
1918//! extern crate rexpect;
2019//!
2120//! use rexpect::spawn;
22- //! use rexpect::error::* ;
21+ //! use rexpect::error::Error ;
2322//!
24- //! fn do_ftp () -> Result<()> {
23+ //! fn main () -> Result<(), Error > {
2524//! let mut p = spawn("ftp speedtest.tele2.net", Some(2000))?;
2625//! p.exp_regex("Name \\(.*\\):")?;
2726//! p.send_line("anonymous")?;
3635//! p.exp_eof()?;
3736//! Ok(())
3837//! }
39- //!
40- //!
41- //! fn main() {
42- //! do_ftp().unwrap_or_else(|e| panic!("ftp job failed with {}", e));
43- //! }
4438//! ```
4539//!
4640//! # Example with bash
5549//! ```no_run
5650//! extern crate rexpect;
5751//! use rexpect::spawn_bash;
58- //! use rexpect::error::* ;
52+ //! use rexpect::error::Error ;
5953//!
60- //!
61- //! fn run() -> Result<()> {
54+ //! fn main() -> Result<(), Error> {
6255//! let mut p = spawn_bash(Some(30_000))?;
6356//! p.execute("ping 8.8.8.8", "bytes of data")?;
6457//! p.send_control('z')?;
7164//! p.exp_string("packet loss")?;
7265//! Ok(())
7366//! }
74- //!
75- //! fn main() {
76- //! run().unwrap_or_else(|e| panic!("bash process failed with {}", e));
77- //! }
78- //!
7967//! ```
8068
8169pub mod error;
You can’t perform that action at this time.
0 commit comments