summaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorsharkdp <davidpeter@web.de>2020-04-21 19:08:19 +0200
committerDavid Peter <sharkdp@users.noreply.github.com>2020-04-22 23:55:28 +0200
commit27974616bfe7ec0c132fc259fdce1b471c99c93e (patch)
treec6ef48e26891944c87aedd39db40689cd572429b /examples
parent319ab779ee6bc8954e7beb2ae34c43d9f327322e (diff)
Initial verison of PrettyPrinter builder
Diffstat (limited to 'examples')
-rw-r--r--examples/simple.rs20
1 files changed, 5 insertions, 15 deletions
diff --git a/examples/simple.rs b/examples/simple.rs
index a0d7afa1..0a6b3d0d 100644
--- a/examples/simple.rs
+++ b/examples/simple.rs
@@ -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");
}