on 448bfaf help sign in
bat/examples/advanced.rs
18 lines 545 B history raw
1/// A program that prints its own source code using the bat library
2use bat::{PagingMode, PrettyPrinter, WrappingMode};
4fn main() {
5 PrettyPrinter::new()
6 .header(true)
7 .grid(true)
8 .line_numbers(true)
9 .use_italics(true)
10 // The following line will be highlighted in the output:
11 .highlight(line!() as usize)
12 .theme("1337")
13 .wrapping_mode(WrappingMode::Character)
14 .paging_mode(PagingMode::QuitIfOneScreen)
15 .input_file(file!())
16 .print()
17 .unwrap();