half-assed fix for newlines in tidepool

This commit is contained in:
tali 2023-04-16 20:11:36 -04:00
parent 6e7d6213aa
commit c8c2573e30
1 changed files with 7 additions and 11 deletions

View File

@ -77,7 +77,7 @@ fn single(args: SingleRun) -> Result<()> {
match msg { match msg {
Msg::Interrupt => { Msg::Interrupt => {
eprintln!("\ncaught interrupt."); eprint!("\ncaught interrupt.");
exit_early.store(true, atomic::Ordering::Relaxed); exit_early.store(true, atomic::Ordering::Relaxed);
} }
Msg::Heartbeat(_id) => { Msg::Heartbeat(_id) => {
@ -98,6 +98,8 @@ fn single(args: SingleRun) -> Result<()> {
// be sent so the ctrl-c handler will abort the program // be sent so the ctrl-c handler will abort the program
std::mem::drop(rx); std::mem::drop(rx);
eprintln!();
if !output.did_complete() && !prompt_yn(&args.io, "run did not finish, keep it?") { if !output.did_complete() && !prompt_yn(&args.io, "run did not finish, keep it?") {
break; break;
} }
@ -140,7 +142,7 @@ fn multi(args: MultiRun) -> Result<()> {
tracing::trace!(msg = debug(&msg)); tracing::trace!(msg = debug(&msg));
match msg { match msg {
Msg::Interrupt => { Msg::Interrupt => {
eprintln!("\ncaught interrupt."); eprint!("\ncaught interrupt.");
tasks.store(0, atomic::Ordering::Relaxed); tasks.store(0, atomic::Ordering::Relaxed);
exit_early.store(true, 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(()) 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" "] {cleared}/{goal} #{pieces}, {pps:.2} pps, {pace} pace"
)?; )?;
if cleared == goal { write!(writer, " ")?;
writeln!(writer) writer.flush()
} else {
write!(writer, " ")?;
writer.flush()
}
} }
fn print_multi_progress( fn print_multi_progress(