mirror of
https://github.com/sharkdp/bat.git
synced 2025-01-31 18:21:04 +00:00
Add PrettyPrinter::input function
This commit is contained in:
parent
981352992b
commit
2f823d59b0
@ -50,6 +50,7 @@
|
|||||||
|
|
||||||
- `PrettyPrinter::vcs_modification_markers` has been marked deprecated when building without the `git` feature, see #997 and #1020 (@eth-p, @sharkdp)
|
- `PrettyPrinter::vcs_modification_markers` has been marked deprecated when building without the `git` feature, see #997 and #1020 (@eth-p, @sharkdp)
|
||||||
- Add APIs to provide `Input` descriptions with `InputDescription` (@eth-p)
|
- Add APIs to provide `Input` descriptions with `InputDescription` (@eth-p)
|
||||||
|
- Add function to directly provide `Input`s to `PrettyPrinter` (@eth-p)
|
||||||
|
|
||||||
## Packaging
|
## Packaging
|
||||||
|
|
||||||
|
@ -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
|
/// Add a file which should be pretty-printed
|
||||||
pub fn input_file(&mut self, path: impl AsRef<OsStr>) -> &mut Self {
|
pub fn input_file(&mut self, path: impl AsRef<OsStr>) -> &mut Self {
|
||||||
self.inputs.push(Input::ordinary_file(path.as_ref()));
|
self.inputs.push(Input::ordinary_file(path.as_ref()));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user