mirror of
https://github.com/sharkdp/bat.git
synced 2024-11-26 17:53:54 +01:00
18 lines
557 B
Rust
18 lines
557 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,
|
|
]))
|
|
.input_files(std::env::args_os().skip(1))
|
|
.run()
|
|
.expect("no errors");
|
|
}
|