#cli #repeat #print #output #terminal #remove #it

liveterm

Simple live-updating output for CLI apps

3 releases (breaking)

0.3.0 Jun 27, 2021
0.2.0 Feb 1, 2021
0.1.0 Feb 1, 2021
Download history 1/week @ 2021-10-01 18/week @ 2021-10-08 10/week @ 2021-10-15 88/week @ 2021-10-22 80/week @ 2021-10-29 53/week @ 2021-11-05 7/week @ 2021-11-12 10/week @ 2021-11-19 6/week @ 2021-11-26 8/week @ 2021-12-03 8/week @ 2021-12-10 19/week @ 2021-12-17 8/week @ 2021-12-24 6/week @ 2021-12-31 19/week @ 2022-01-07 17/week @ 2022-01-14

51 downloads per month
Used in 2 crates

Unlicense

9KB
146 lines

Liveterm

Print stuff to the terminal, remove it, repeat!

Here's how to use it:

let mut tp = TermPrinter::new(std::io::stdout());
for i in 0..10 {
    tp.clear()?;              // clear what we draw last time
    tp.buf.clear();           // clear the buffer
    write!(tp.buf, "{}", i)?; // fill the buffer
    tp.print()?;              // draw the buffer
}

lib.rs:

Print stuff to the terminal, remove it, repeat!

Here's how to use it:

use liveterm::TermPrinter;
use std::fmt::Write;
# fn main() -> Result<(), Box<dyn std::error::Error>> {
let mut tp = TermPrinter::new(std::io::stdout());
for i in 0..10 {
tp.clear()?;              // clear what we draw last time
tp.buf.clear();           // clear the buffer
write!(tp.buf, "{}", i)?; // fill the buffer
tp.print()?;              // draw the buffer
}
# Ok(())
# }

Dependencies

~0.9–1.2MB
~25K SLoC

E`