fix: add printer method to reset ansi formatting
This commit is contained in:
parent
600516bad1
commit
e4d3e7a86b
2
Cargo.lock
generated
2
Cargo.lock
generated
@ -297,7 +297,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "grip-grab"
|
||||
version = "0.2.6"
|
||||
version = "0.2.8"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"clap",
|
||||
|
@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "grip-grab"
|
||||
version = "0.2.6"
|
||||
version = "0.2.8"
|
||||
edition = "2021"
|
||||
authors = ["Alexandre Pasmantier <alex.pasmant@gmail.com>"]
|
||||
license = "Apache-2.0"
|
||||
|
@ -63,6 +63,5 @@ pub fn main() -> anyhow::Result<()> {
|
||||
.for_each(|file_results| printer.write(file_results).unwrap());
|
||||
|
||||
printer.print()?;
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
@ -131,6 +131,12 @@ impl Printer {
|
||||
}
|
||||
|
||||
pub fn print(&mut self) -> Result<()> {
|
||||
self.writer.print(&self.buffer)
|
||||
self.writer.print(&self.buffer);
|
||||
self.reset_ansi_formatting()
|
||||
}
|
||||
|
||||
fn reset_ansi_formatting(&mut self) -> Result<()> {
|
||||
self.buffer.reset();
|
||||
self.write_newline_to_buffer()
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user