1
0
mirror of https://github.com/sharkdp/bat synced 2026-06-09 10:03:18 +00:00
Files
sharkdp--bat/examples/cat.rs
T

18 lines
551 B
Rust

/// 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 console::Term;
fn main() {
PrettyPrinter::new()
.term_width(Term::stdout().size().1 as usize)
.style_components(StyleComponents::new(&[
StyleComponent::Header,
StyleComponent::Grid,
StyleComponent::Numbers,
]))
.files(std::env::args_os().skip(1))
.run()
.expect("no errors");
}