on 522ab7a help sign in
bat/examples/simple.rs
20 lines 541 B history raw
1/// A simple program that prints its own source code using the bat library
2use bat::{
3 config::{Config, InputFile},
4 Controller, HighlightingAssets,
5};
6use std::ffi::OsStr;
8fn main() {
9 let path_to_this_file = OsStr::new(file!());
11 let config = Config {
12 files: vec![InputFile::Ordinary(path_to_this_file)],
13 colored_output: true,
14 true_color: true,
15 ..Default::default()
16 };
17 let assets = HighlightingAssets::from_binary();
19 Controller::new(&config, &assets).run().expect("no errors");