@@ -1,29 +1,18 @@
1+/// A simple program that prints its own source code using the bat library
2− config::{Config, InputFile, StyleComponent, StyleComponents},
4+ config::{Config, InputFile},
3 Controller, HighlightingAssets,
5 Controller, HighlightingAssets,
5−use console::Term;
7+use std::ffi::OsStr;
9− let files = std::env::args_os().skip(1).collect::<Vec<_>>();
10+ let path_to_this_file = OsStr::new(file!());
11− if files.is_empty() {
12− eprintln!("No input files specified");
16 let config = Config {
12 let config = Config {
17− term_width: Term::stdout().size().1 as usize,
13+ files: vec![InputFile::Ordinary(path_to_this_file)],
18 colored_output: true,
14 colored_output: true,
19 true_color: true,
15 true_color: true,
20− style_components: StyleComponents::new(&[
21− StyleComponent::Header,
22− StyleComponent::Grid,
23− StyleComponent::Numbers,
25− files: files.iter().map(|file| InputFile::Ordinary(file)).collect(),
26− theme: "1337".into(),
27 ..Default::default()
16 ..Default::default()
29 let assets = HighlightingAssets::from_binary();
18 let assets = HighlightingAssets::from_binary();