Files

22 lines
586 B
Rust
Raw Permalink Normal View History

2025-03-26 14:59:41 +01:00
use bat::{
assets::HighlightingAssets, config::Config, controller::Controller, output::OutputHandle, Input,
};
2023-07-09 01:49:45 +01:00
fn main() {
let mut buffer = String::new();
let config = Config {
colored_output: true,
..Default::default()
};
let assets = HighlightingAssets::from_binary();
let controller = Controller::new(&config, &assets);
let input = Input::from_file(file!());
controller
2025-03-26 14:59:41 +01:00
.run(
vec![input.into()],
2024-09-05 18:27:29 -04:00
Some(&mut OutputHandle::FmtWrite(&mut buffer)),
2025-03-26 14:59:41 +01:00
)
2023-07-09 01:49:45 +01:00
.unwrap();
println!("{buffer}");
}