This commit is contained in:
parent
3637091341
commit
95c394cbaf
10
src/main.rs
10
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::<Vec<u8>>())).transpose()?;
|
||||
std::io::stderr().write_all(b"\n")?;
|
||||
std::io::stderr().write_all(resulting_commandline.as_bytes())?;
|
||||
}
|
||||
|
||||
Ok(())
|
||||
|
Loading…
Reference in New Issue
Block a user