Simplify style_components

This commit is contained in:
sharkdp
2020-04-22 20:35:05 +02:00
committed by David Peter
parent a8f759c080
commit 36dde9275a
2 changed files with 16 additions and 8 deletions

View File

@ -1,16 +1,16 @@
/// A very simple colorized `cat` clone, using `bat` as a library.
/// See `src/bin/bat` for the full `bat` application.
use bat::{PrettyPrinter, StyleComponent, StyleComponents};
use bat::{PrettyPrinter, StyleComponent};
use console::Term;
fn main() {
PrettyPrinter::new()
.term_width(Term::stdout().size().1 as usize)
.style_components(StyleComponents::new(&[
.style_components(&[
StyleComponent::Header,
StyleComponent::Grid,
StyleComponent::Numbers,
]))
])
.input_files(std::env::args_os().skip(1))
.print()
.expect("no errors");