Compare commits

...

4 Commits
v1.2.0 ... main

Author SHA1 Message Date
e177b26348
refactor: remove unused imports in main.rs
All checks were successful
Release / Release (push) Successful in 34s
2024-08-28 13:19:38 +02:00
2dbc4d6a28
feat: add shell_completion dependency and import
All checks were successful
Release / Release (push) Successful in 34s
2024-08-28 13:10:26 +02:00
0a5d3e11e4
feat: add current directory display in main loop
All checks were successful
Release / Release (push) Successful in 34s
2024-08-28 13:01:08 +02:00
5961309bab
style(main): remove unused result warnings in main.rs
All checks were successful
Release / Release (push) Successful in 33s
2024-08-28 12:36:07 +02:00
3 changed files with 14 additions and 2 deletions

9
Cargo.lock generated

@ -5,3 +5,12 @@ version = 3
[[package]] [[package]]
name = "jshell" name = "jshell"
version = "0.1.0" 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"

@ -4,3 +4,4 @@ version = "0.1.0"
edition = "2021" edition = "2021"
[dependencies] [dependencies]
shell_completion = "0.0.2"

@ -2,8 +2,10 @@ use std::{env, io::{stdin, stdout, Write}, path::Path, process::{Child, Command,
fn main(){ fn main(){
loop { loop {
println!("");
println!("{}", env::current_dir().unwrap().to_str().unwrap());
print!("> "); print!("> ");
stdout().flush(); let _ = stdout().flush();
let mut input = String::new(); let mut input = String::new();
stdin().read_line(&mut input).unwrap(); stdin().read_line(&mut input).unwrap();
@ -66,7 +68,7 @@ fn main(){
if let Some(mut final_command) = previous_command { if let Some(mut final_command) = previous_command {
// block until the final command has finished // block until the final command has finished
final_command.wait(); let _ = final_command.wait();
} }
} }