mirror of
https://github.com/sharkdp/bat.git
synced 2024-11-22 07:43:39 +01:00
Add paging to advanced example
This commit is contained in:
parent
12eee0c590
commit
cba9df746e
@ -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();
|
||||
|
@ -41,3 +41,6 @@ pub use line_range::LineRange;
|
||||
pub use pretty_printer::PrettyPrinter;
|
||||
pub use syntax_mapping::{MappingTarget, SyntaxMapping};
|
||||
pub use wrapping::WrappingMode;
|
||||
|
||||
#[cfg(feature = "paging")]
|
||||
pub use config::PagingMode;
|
||||
|
Loading…
Reference in New Issue
Block a user