mirror of
https://github.com/sharkdp/bat.git
synced 2025-09-16 10:12:26 +01:00
Add InputDescription
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
use std::ffi::OsStr;
|
||||
use std::io::Read;
|
||||
|
||||
use crate::{
|
||||
config::{
|
||||
@@ -52,6 +53,18 @@ impl<'a> PrettyPrinter<'a> {
|
||||
self
|
||||
}
|
||||
|
||||
/// Add STDIN as an input
|
||||
pub fn input_stdin(&mut self) -> &mut Self {
|
||||
self.inputs.push(Input::StdIn(None));
|
||||
self
|
||||
}
|
||||
|
||||
/// Add STDIN as an input
|
||||
pub fn input_reader(&mut self, reader: impl Read) -> &mut Self {
|
||||
//self.inputs.push(Input::FromReader(Box::new(reader), None));
|
||||
self
|
||||
}
|
||||
|
||||
/// Specify the syntax file which should be used (default: auto-detect)
|
||||
pub fn language(&mut self, language: &'a str) -> &mut Self {
|
||||
self.config.language = Some(language);
|
||||
|
Reference in New Issue
Block a user