bat/examples/simple.rs

13 lines
294 B
Rust
Raw Normal View History

2020-03-21 20:45:03 +00:00
/// A simple program that prints its own source code using the bat library
use bat::PrettyPrinter;
2020-03-21 20:45:03 +00:00
use std::ffi::OsStr;
2019-10-20 19:53:34 +00:00
fn main() {
2020-03-21 20:45:03 +00:00
let path_to_this_file = OsStr::new(file!());
2019-10-20 19:53:34 +00:00
2020-04-21 19:29:47 +00:00
PrettyPrinter::new()
.input_file(path_to_this_file)
.run()
.expect("no errors");
2019-10-20 19:53:34 +00:00
}