diff --git a/Cargo.lock b/Cargo.lock index 79262b3..50f7213 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -5,3 +5,12 @@ version = 3 [[package]] name = "jshell" version = "0.1.0" +dependencies = [ + "shell_completion", +] + +[[package]] +name = "shell_completion" +version = "0.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73937c192504363290613e241705a02dff92ae7c03f544e2a69bbef24cc1042c" diff --git a/Cargo.toml b/Cargo.toml index 023b8d3..b2a72a2 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -4,3 +4,4 @@ version = "0.1.0" edition = "2021" [dependencies] +shell_completion = "0.0.2" diff --git a/src/main.rs b/src/main.rs index 6085b11..f18ab02 100644 --- a/src/main.rs +++ b/src/main.rs @@ -2,8 +2,10 @@ use std::{env, io::{stdin, stdout, Write}, path::Path, process::{Child, Command, fn main(){ loop { + println!(""); + println!("{}", env::current_dir().unwrap().to_str().unwrap()); print!("> "); - stdout().flush(); + let _ = stdout().flush(); let mut input = String::new(); stdin().read_line(&mut input).unwrap(); @@ -66,7 +68,7 @@ fn main(){ if let Some(mut final_command) = previous_command { // block until the final command has finished - final_command.wait(); + let _ = final_command.wait(); } }