diff --git a/src/main.rs b/src/main.rs index d636886..8392093 100644 --- a/src/main.rs +++ b/src/main.rs @@ -202,7 +202,7 @@ fn main() -> Result<()> { let backend = CrosstermBackend::new(stdout); let mut terminal = Terminal::new(backend)?; - let res = run_app(&mut terminal, &mut app); + let resulting_commandline = run_app(&mut terminal, &mut app); // Restore terminal disable_raw_mode()?; @@ -214,13 +214,13 @@ fn main() -> Result<()> { )?; terminal.show_cursor()?; - let res = res?; + let resulting_commandline = resulting_commandline?; - if let Some(res) = res { - std::io::stderr().write_all(res.as_bytes())?; - std::io::stderr().write_all(b"\n")?; + if let Some(resulting_commandline) = resulting_commandline { // TODO: I do not want to collect the whole thing into a vec app.command_options.read().command_result.as_ref().map(|r| std::io::stdout().write_all(&r.stdout.bytes().collect::>())).transpose()?; + std::io::stderr().write_all(b"\n")?; + std::io::stderr().write_all(resulting_commandline.as_bytes())?; } Ok(())