1use colored::Colorize;
9use std::io::{stdin, BufRead, Error};
10use std::result::Result;
11
12pub fn run() -> Result<(), Error> {
13 for line in stdin().lock().lines() {
14 let line = line?;
15
16 if line.starts_with("---") {
17 println!("{}", line.yellow());
18 } else if line.starts_with("+++") {
19 println!("{}", line.yellow());
20 } else if line.starts_with("@@ ") {
21 println!("{}", line.cyan());
22 } else if line.starts_with("+") {
23 println!("{}", line.green());
24 } else if line.starts_with("-") {
25 println!("{}", line.red());
26 } else {
27 println!("{}", line);
28 }
29 }
30
31 Ok(())
32}