Print command after output
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
Austen Adler 2023-02-18 16:23:38 -05:00
parent 3637091341
commit 95c394cbaf

View File

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