mirror of
https://github.com/sharkdp/bat
synced 2024-11-15 08:37:12 +00:00
Add paging to advanced example
This commit is contained in:
parent
12eee0c590
commit
cba9df746e
2 changed files with 5 additions and 1 deletions
|
@ -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 a new issue