Add paging to advanced example

This commit is contained in:
sharkdp authored and David Peter committed 2020-04-22 23:55:28 +02:00
1 parent 12eee0c590
commit cba9df746e
2 files changed
+5 -1

No files matched your search

+2 -1
View File
@@ -1,5 +1,5 @@
/// A program that prints its own source code using the bat library
use bat::{LineRange, PrettyPrinter, WrappingMode};
use bat::{LineRange, PrettyPrinter, WrappingMode, PagingMode};
fn main() {
PrettyPrinter::new()
@@ -11,6 +11,7 @@ fn main() {
.highlight(LineRange::new(line!() as usize, line!() as usize))
.theme("1337")
.wrapping_mode(WrappingMode::Character)
.paging_mode(PagingMode::QuitIfOneScreen)
.input_file(file!())
.print()
.unwrap();