1
0
mirror of https://github.com/sharkdp/bat.git synced 2025-09-02 11:22:30 +01:00

Add PrettyPrinter::input function

This commit is contained in:
Ethan P
2020-05-15 16:18:44 -07:00
committed by David Peter
parent 981352992b
commit 2f823d59b0
2 changed files with 7 additions and 0 deletions

View File

@@ -55,6 +55,12 @@ impl<'a> PrettyPrinter<'a> {
}
}
/// Add an input which should be pretty-printed
pub fn input(&mut self, input: Input<'a>) -> &mut Self {
self.inputs.push(input);
self
}
/// Add a file which should be pretty-printed
pub fn input_file(&mut self, path: impl AsRef<OsStr>) -> &mut Self {
self.inputs.push(Input::ordinary_file(path.as_ref()));