mirror of
https://github.com/sharkdp/bat.git
synced 2025-01-31 02:01:05 +00: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
|
/// 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() {
|
fn main() {
|
||||||
PrettyPrinter::new()
|
PrettyPrinter::new()
|
||||||
@ -11,6 +11,7 @@ fn main() {
|
|||||||
.highlight(LineRange::new(line!() as usize, line!() as usize))
|
.highlight(LineRange::new(line!() as usize, line!() as usize))
|
||||||
.theme("1337")
|
.theme("1337")
|
||||||
.wrapping_mode(WrappingMode::Character)
|
.wrapping_mode(WrappingMode::Character)
|
||||||
|
.paging_mode(PagingMode::QuitIfOneScreen)
|
||||||
.input_file(file!())
|
.input_file(file!())
|
||||||
.print()
|
.print()
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
@ -41,3 +41,6 @@ pub use line_range::LineRange;
|
|||||||
pub use pretty_printer::PrettyPrinter;
|
pub use pretty_printer::PrettyPrinter;
|
||||||
pub use syntax_mapping::{MappingTarget, SyntaxMapping};
|
pub use syntax_mapping::{MappingTarget, SyntaxMapping};
|
||||||
pub use wrapping::WrappingMode;
|
pub use wrapping::WrappingMode;
|
||||||
|
|
||||||
|
#[cfg(feature = "paging")]
|
||||||
|
pub use config::PagingMode;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user