diff --git a/Cargo.lock b/Cargo.lock index 20c2401..82471bd 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -30,7 +30,7 @@ dependencies = [ [[package]] name = "aio-cli" -version = "0.7.2" +version = "0.7.3" dependencies = [ "aio-cargo-info", "anyhow", @@ -294,11 +294,11 @@ dependencies = [ [[package]] name = "crossterm" -version = "0.27.0" +version = "0.26.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f476fe445d41c9e991fd07515a6f463074b782242ccf4a5b7b1d1012e70824df" +checksum = "a84cda67535339806297f1b331d6dd6320470d2a0fe65381e79ee9e156dd3d13" dependencies = [ - "bitflags 2.4.0", + "bitflags 1.3.2", "crossterm_winapi", "libc", "mio", diff --git a/Cargo.toml b/Cargo.toml index 32e48a6..328a48f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "aio-cli" description = "Streamlined AI Terminal Interactions" -version = "0.7.2" +version = "0.7.3" edition = "2021" authors = ["Gabin Lefranc "] readme = "README.md" @@ -22,7 +22,7 @@ anyhow = "1.0" async-trait = "0.1" bytes = "1.1.0" clap = { version = "4.2.2", features = ["derive"] } -crossterm = "0.27" +crossterm = "0.26" num-traits = "0.2" once_cell = "1.18" pin-project = "1.1" diff --git a/src/arguments.rs b/src/arguments.rs index 0fb1b17..6840f64 100644 --- a/src/arguments.rs +++ b/src/arguments.rs @@ -50,7 +50,7 @@ pub enum RunChoice { /// Run code without asking Force } - +#[derive(Default, Debug, Clone)] pub struct ProcessedArgs { pub config_path: String, pub creds_path: String, diff --git a/src/main.rs b/src/main.rs index de4c893..aa08f25 100644 --- a/src/main.rs +++ b/src/main.rs @@ -64,8 +64,10 @@ async fn main() -> Result<(), String> { if let None = args.input { use std::io::Read; let mut str_input = std::string::String::new(); - std::io::stdin().lock().read_to_string(&mut str_input).map_err(|e| format!("Failed to read input from stdin: {}", e))?; - args.input = Some(str_input); + let mut stdin = std::io::stdin(); + stdin.read_to_string(&mut str_input).map_err(|e| format!("Failed to read input from stdin: {}", e))?; + + args.input = Some(str_input.trim().to_string()); } args::ProcessedArgs::from(args) };