Skip to content

Commit

Permalink
Fix cargo fmt
Browse files Browse the repository at this point in the history
Signed-off-by: Maxim Zhiburt <zhiburt@gmail.com>
  • Loading branch information
zhiburt committed Jul 3, 2023
1 parent a8b570f commit e8b43ff
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions examples/shell.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,18 +30,19 @@ fn exec(shell: &mut ReplSession, cmd: &str) -> Result<String> {
}

#[cfg(all(unix, feature = "async"))]
fn main() -> Result<()>{
fn main() -> Result<()> {
futures_lite::future::block_on(async {
let mut p = expectrl::spawn("sh")?;
p.get_process_mut().set_echo(true, None)?;

let mut shell = ReplSession::new(p, String::from("sh-5.1$"), Some(String::from("exit")), true);


let mut shell =
ReplSession::new(p, String::from("sh-5.1$"), Some(String::from("exit")), true);

shell.expect_prompt().await?;

let output = exec(&mut shell, "echo Hello World").await?;
println!("{:?}", output);

let output = exec(&mut shell, "echo '2 + 3' | bc").await?;
println!("{:?}", output);

Expand Down

0 comments on commit e8b43ff

Please sign in to comment.