mirror of
https://github.com/sharkdp/bat
synced 2024-11-23 04:13:11 +00:00
17 lines
493 B
Rust
17 lines
493 B
Rust
use bat::{assets::HighlightingAssets, config::Config, controller::Controller, Input};
|
|
|
|
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
|
|
.run(vec![input.into()], Some(&mut buffer))
|
|
.unwrap();
|
|
|
|
println!("{buffer}");
|
|
}
|