mirror of
https://github.com/sharkdp/bat.git
synced 2025-01-18 12:05:52 +00:00
Update 'cat' example
This commit is contained in:
parent
74d4377ed2
commit
0c9e044e41
@ -1,16 +1,12 @@
|
||||
/// A very simple colorized `cat` clone, using `bat` as a library.
|
||||
/// See `src/bin/bat` for the full `bat` application.
|
||||
use bat::{PrettyPrinter, StyleComponent};
|
||||
use console::Term;
|
||||
use bat::PrettyPrinter;
|
||||
|
||||
fn main() {
|
||||
PrettyPrinter::new()
|
||||
.term_width(Term::stdout().size().1 as usize)
|
||||
.style_components(&[
|
||||
StyleComponent::Header,
|
||||
StyleComponent::Grid,
|
||||
StyleComponent::LineNumbers,
|
||||
])
|
||||
.header(true)
|
||||
.grid(true)
|
||||
.line_numbers(true)
|
||||
.input_files(std::env::args_os().skip(1))
|
||||
.print()
|
||||
.expect("no errors");
|
||||
|
Loading…
x
Reference in New Issue
Block a user