2
0
mirror of https://github.com/sharkdp/bat synced 2024-11-06 21:20:25 +00:00
bat/examples/simple.rs
2020-03-21 23:53:53 +01:00

21 lines
541 B
Rust

/// A simple program that prints its own source code using the bat library
use bat::{
config::{Config, InputFile},
Controller, HighlightingAssets,
};
use std::ffi::OsStr;
fn main() {
let path_to_this_file = OsStr::new(file!());
let config = Config {
files: vec![InputFile::Ordinary(path_to_this_file)],
colored_output: true,
true_color: true,
..Default::default()
};
let assets = HighlightingAssets::from_binary();
Controller::new(&config, &assets).run().expect("no errors");
}