mirror of
https://github.com/sharkdp/bat.git
synced 2026-10-26 20:16:33 +00:00
Update examples
This commit is contained in:
1 parent
0f06d3b90d
commit
3eb704e016
2 files changed
+21
-2
No files matched your search
@@ -0,0 +1,19 @@
|
||||
/// A small demonstration of the Input API.
|
||||
/// This prints embedded bytes with a custom header and then reads from STDIN.
|
||||
use bat::{Input, PrettyPrinter};
|
||||
|
||||
fn main() {
|
||||
PrettyPrinter::new()
|
||||
.header(true)
|
||||
.grid(true)
|
||||
.line_numbers(true)
|
||||
.inputs(vec![
|
||||
Input::from_bytes(b"echo 'Hello World!'")
|
||||
.name("embedded.sh")
|
||||
.title("An embedded shell script.")
|
||||
.kind("Embedded"),
|
||||
Input::from_stdin().title("Standard Input").kind("FD"),
|
||||
])
|
||||
.print()
|
||||
.unwrap();
|
||||
}
|
||||
Reference in new issue
Block a user