A small utility crate using https://github.com/mitsuhiko/console to write to stdout but limited to a given number of lines. The oldest line is removed when writing a new line.
From examples/five.rs:
```rust use term_snip::TermSnip;
use std::{thread, time};
/// A simple example writing 15 lines to stdout but only showing /// a maximum of five lines. fn main() { let halfsec = time::Duration::frommillis(500);
let mut term = TermSnip::new(5);
for n in 1..15 {
term.write_line(&format!("{} - line number {}", n, n)).unwrap();
// just to slow down for demonstration
thread::sleep(half_sec);
}
}
```
Screenshot showing above example in action
Licensed under either of
at your option.