File: buffer.rs

package info (click to toggle)
rust-bat 0.25.0-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 3,096 kB
  • sloc: sh: 255; python: 39; makefile: 14
file content (17 lines) | stat: -rw-r--r-- 493 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
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}");
}