mirror of
https://github.com/sharkdp/bat.git
synced 2025-02-07 13:41:14 +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.
|
/// A very simple colorized `cat` clone, using `bat` as a library.
|
||||||
/// See `src/bin/bat` for the full `bat` application.
|
/// See `src/bin/bat` for the full `bat` application.
|
||||||
use bat::{PrettyPrinter, StyleComponent};
|
use bat::PrettyPrinter;
|
||||||
use console::Term;
|
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
PrettyPrinter::new()
|
PrettyPrinter::new()
|
||||||
.term_width(Term::stdout().size().1 as usize)
|
.header(true)
|
||||||
.style_components(&[
|
.grid(true)
|
||||||
StyleComponent::Header,
|
.line_numbers(true)
|
||||||
StyleComponent::Grid,
|
|
||||||
StyleComponent::LineNumbers,
|
|
||||||
])
|
|
||||||
.input_files(std::env::args_os().skip(1))
|
.input_files(std::env::args_os().skip(1))
|
||||||
.print()
|
.print()
|
||||||
.expect("no errors");
|
.expect("no errors");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user