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

Separate inputs from config

This commit is contained in:
sharkdp
2020-04-21 21:14:44 +02:00
committed by David Peter
parent 5e5cb89da6
commit 1dc328ad49
10 changed files with 61 additions and 41 deletions

View File

@@ -243,6 +243,10 @@ impl<'a> Printer for InteractivePrinter<'a> {
),
InputFile::StdIn(None) => "STDIN".to_owned(),
InputFile::ThemePreviewFile => "".to_owned(),
InputFile::FromReader(_, Some(name)) => {
format!("file '{}'", name.to_string_lossy())
}
InputFile::FromReader(_, None) => "READER".to_owned(),
};
writeln!(
@@ -286,6 +290,10 @@ impl<'a> Printer for InteractivePrinter<'a> {
}
InputFile::StdIn(None) => ("File: ", Cow::from("STDIN".to_owned())),
InputFile::ThemePreviewFile => ("", Cow::from("")),
InputFile::FromReader(_, Some(name)) => {
("File: ", Cow::from(name.to_string_lossy().to_owned()))
}
InputFile::FromReader(_, None) => ("File: ", Cow::from("READER".to_owned())),
};
let mode = match self.content_type {