diff options
author | sharkdp <davidpeter@web.de> | 2020-04-22 21:17:59 +0200 |
---|---|---|
committer | David Peter <sharkdp@users.noreply.github.com> | 2020-04-22 23:55:28 +0200 |
commit | 0c9e044e4152c403691640d8c6b44fb4120554ec (patch) | |
tree | 7367633f31bb065bc92bd6a2215e8e9a9a5c849c /examples | |
parent | 74d4377ed28c4350807c967597ba5081f2ce7a74 (diff) |
Update 'cat' example
Diffstat (limited to 'examples')
-rw-r--r-- | examples/cat.rs | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/examples/cat.rs b/examples/cat.rs index 9171e6ad..a42ed8d0 100644 --- a/examples/cat.rs +++ b/examples/cat.rs @@ -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"); |