2020-03-21 20:45:03 +00:00
|
|
|
/// A simple program that prints its own source code using the bat library
|
2019-10-20 19:53:34 +00:00
|
|
|
use bat::{
|
2020-03-21 20:45:03 +00:00
|
|
|
config::{Config, InputFile},
|
2020-03-21 20:15:12 +00:00
|
|
|
Controller, HighlightingAssets,
|
2019-10-20 19:53:34 +00:00
|
|
|
};
|
2020-03-21 20:45:03 +00:00
|
|
|
use std::ffi::OsStr;
|
2019-10-20 19:53:34 +00:00
|
|
|
|
|
|
|
fn main() {
|
2020-03-21 20:45:03 +00:00
|
|
|
let path_to_this_file = OsStr::new(file!());
|
2019-10-20 19:53:34 +00:00
|
|
|
|
|
|
|
let config = Config {
|
2020-03-21 20:45:03 +00:00
|
|
|
files: vec![InputFile::Ordinary(path_to_this_file)],
|
2019-10-20 19:53:34 +00:00
|
|
|
colored_output: true,
|
|
|
|
true_color: true,
|
|
|
|
..Default::default()
|
|
|
|
};
|
2020-03-21 15:48:27 +00:00
|
|
|
let assets = HighlightingAssets::from_binary();
|
2019-10-20 19:53:34 +00:00
|
|
|
|
|
|
|
Controller::new(&config, &assets).run().expect("no errors");
|
|
|
|
}
|