From c8c2573e30d4185ccbecbd985bd1db0af3bfa71c Mon Sep 17 00:00:00 2001 From: tali Date: Sun, 16 Apr 2023 20:11:36 -0400 Subject: [PATCH] half-assed fix for newlines in tidepool --- tidepool/src/main.rs | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/tidepool/src/main.rs b/tidepool/src/main.rs index 7871063..8821eda 100644 --- a/tidepool/src/main.rs +++ b/tidepool/src/main.rs @@ -77,7 +77,7 @@ fn single(args: SingleRun) -> Result<()> { match msg { Msg::Interrupt => { - eprintln!("\ncaught interrupt."); + eprint!("\ncaught interrupt."); exit_early.store(true, atomic::Ordering::Relaxed); } Msg::Heartbeat(_id) => { @@ -98,6 +98,8 @@ fn single(args: SingleRun) -> Result<()> { // be sent so the ctrl-c handler will abort the program std::mem::drop(rx); + eprintln!(); + if !output.did_complete() && !prompt_yn(&args.io, "run did not finish, keep it?") { break; } @@ -140,7 +142,7 @@ fn multi(args: MultiRun) -> Result<()> { tracing::trace!(msg = debug(&msg)); match msg { Msg::Interrupt => { - eprintln!("\ncaught interrupt."); + eprint!("\ncaught interrupt."); tasks.store(0, atomic::Ordering::Relaxed); exit_early.store(true, atomic::Ordering::Relaxed); } @@ -175,9 +177,7 @@ fn multi(args: MultiRun) -> Result<()> { } } - if !args.io.quiet { - eprintln!(); - } + eprintln!(); Ok(()) } @@ -268,12 +268,8 @@ fn print_single_progress(io_args: &IoArgs, status: &Status, goal: usize) -> std: "] {cleared}/{goal} #{pieces}, {pps:.2} pps, {pace} pace" )?; - if cleared == goal { - writeln!(writer) - } else { - write!(writer, " ")?; - writer.flush() - } + write!(writer, " ")?; + writer.flush() } fn print_multi_progress(