mirror of
https://github.com/sharkdp/bat.git
synced 2025-01-19 04:21:06 +00:00
Only print contents if file wasn't empty, or EOF wasn't first thing received from stdin.
This commit is contained in:
parent
10c5f79640
commit
76b7418e35
@ -80,7 +80,9 @@ impl<'b> Controller<'b> {
|
|||||||
input_file: InputFile<'a>,
|
input_file: InputFile<'a>,
|
||||||
) -> Result<()> {
|
) -> Result<()> {
|
||||||
printer.print_header(writer, input_file)?;
|
printer.print_header(writer, input_file)?;
|
||||||
self.print_file_ranges(printer, writer, reader, &self.config.line_ranges)?;
|
if !reader.first_line.is_empty() {
|
||||||
|
self.print_file_ranges(printer, writer, reader, &self.config.line_ranges)?;
|
||||||
|
}
|
||||||
printer.print_footer(writer)?;
|
printer.print_footer(writer)?;
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
|
Loading…
x
Reference in New Issue
Block a user