Write error messages to pager, if attached

closes #946
This commit is contained in:
sharkdp authored and David Peter committed 2020-04-25 13:08:00 +02:00
1 parent 3bcc4d0d55
commit 48a7ce3bf2
4 files changed
+37 -10

No files matched your search

+14
View File
@@ -125,6 +125,20 @@ impl OutputType {
OutputType::Stdout(io::stdout())
}
#[cfg(feature = "paging")]
pub(crate) fn is_pager(&self) -> bool {
if let OutputType::Pager(_) = self {
true
} else {
false
}
}
#[cfg(not(feature = "paging"))]
pub(crate) fn is_pager(&self) -> bool {
false
}
pub fn handle(&mut self) -> Result<&mut dyn Write> {
Ok(match *self {
#[cfg(feature = "paging")]