mirror of
https://github.com/sharkdp/bat
synced 2026-08-08 19:41:45 +00:00
Updates for review of PR 899
This commit is contained in:
committed by
David Peter
parent
014d754588
commit
42e3825daf
+6
-6
@@ -2,6 +2,7 @@ use std::io::{self, Write};
|
||||
#[cfg(feature = "paging")]
|
||||
use std::process::Child;
|
||||
|
||||
#[cfg(feature = "paging")]
|
||||
use crate::config::PagingMode;
|
||||
use crate::errors::*;
|
||||
#[cfg(feature = "paging")]
|
||||
@@ -15,13 +16,12 @@ pub enum OutputType {
|
||||
}
|
||||
|
||||
impl OutputType {
|
||||
#[cfg(feature = "paging")]
|
||||
pub fn from_mode(mode: PagingMode, pager: Option<&str>) -> Result<Self> {
|
||||
let _ = pager;
|
||||
use self::PagingMode::*;
|
||||
Ok(match mode {
|
||||
#[cfg(feature = "paging")]
|
||||
PagingMode::Always => OutputType::try_pager(false, pager)?,
|
||||
#[cfg(feature = "paging")]
|
||||
PagingMode::QuitIfOneScreen => OutputType::try_pager(true, pager)?,
|
||||
Always => OutputType::try_pager(false, pager)?,
|
||||
QuitIfOneScreen => OutputType::try_pager(true, pager)?,
|
||||
_ => OutputType::stdout(),
|
||||
})
|
||||
}
|
||||
@@ -116,7 +116,7 @@ impl OutputType {
|
||||
}
|
||||
}
|
||||
|
||||
fn stdout() -> Self {
|
||||
pub(crate) fn stdout() -> Self {
|
||||
OutputType::Stdout(io::stdout())
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user