Initial verison of PrettyPrinter builder

This commit is contained in:
sharkdp authored and David Peter committed 2020-04-22 23:55:28 +02:00
1 parent 319ab779ee
commit 27974616bf
4 files changed
+53 -16

No files matched your search

+5 -15
View File
@@ -1,22 +1,12 @@
/// A simple program that prints its own source code using the bat library
use bat::{
config::{Config, InputFile, OrdinaryFile},
Controller, HighlightingAssets,
};
use bat::PrettyPrinter;
use std::ffi::OsStr;
fn main() {
let path_to_this_file = OsStr::new(file!());
let config = Config {
files: vec![InputFile::Ordinary(OrdinaryFile::from_path(
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");
PrettyPrinter::new()
.file(path_to_this_file)
.run()
.expect("no errors");
}