paris/formatter/concerns/ansi.rs
1/// Escape whatever's being sent
2/// in here to an ansi code
3pub struct Ansi {}
4
5impl Ansi {
6 /// Add the required escape and terminator characters to
7 /// an ansi code.
8 pub fn escape(code: u8) -> String {
9 format!("\x1B[{}m", code)
10 }
11
12 /// Clears the line of all characters
13 pub fn clear_line() {
14 print!("\r\x1B[2K");
15 }
16}