2020-03-21 21:45:03 +01:00
|
|
|
/// A very simple colorized `cat` clone, using `bat` as a library.
|
|
|
|
/// See `src/bin/bat` for the full `bat` application.
|
2020-04-21 20:06:09 +02:00
|
|
|
use bat::{PrettyPrinter, StyleComponent, StyleComponents};
|
2020-03-21 21:45:03 +01:00
|
|
|
use console::Term;
|
|
|
|
|
|
|
|
fn main() {
|
2020-04-21 21:14:44 +02:00
|
|
|
let mut printer = PrettyPrinter::new();
|
|
|
|
|
|
|
|
printer
|
2020-04-21 20:06:09 +02:00
|
|
|
.term_width(Term::stdout().size().1 as usize)
|
|
|
|
.style_components(StyleComponents::new(&[
|
2020-03-21 21:45:03 +01:00
|
|
|
StyleComponent::Header,
|
|
|
|
StyleComponent::Grid,
|
|
|
|
StyleComponent::Numbers,
|
2020-04-21 20:06:09 +02:00
|
|
|
]))
|
2020-04-21 21:14:44 +02:00
|
|
|
.files(std::env::args_os().skip(1));
|
|
|
|
|
|
|
|
printer.run().expect("no errors");
|
2020-03-21 21:45:03 +01:00
|
|
|
}
|