Add InputDescription

This commit is contained in:
sharkdp authored and David Peter committed 2020-04-22 23:55:28 +02:00
1 parent 3bacfc5184
commit f3b90ddb38
5 files changed
+139 -107

No files matched your search

+13
View File
@@ -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);