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