1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
use std::fs::File;
use std::io::Read;
use crate::color;
use crate::flag;
use crate::setting;
pub fn run(path: &str, flags: flag::Flags, params: Option<setting::Params>) {
let mut f = File::open(path).expect("File open failed");
let mut contents = String::new();
f.read_to_string(&mut contents).expect("Somothing went wrong reading the file");
if *flags.nocolor() {
println!("{}", contents);
} else {
color::coloring_from_file(contents, params);
}
}