From 6010ed52131391650f12bef2a50d4a3fd45b2f1d Mon Sep 17 00:00:00 2001 From: FliegendeWurst <2012gdwu@web.de> Date: Sat, 12 Oct 2019 11:58:31 +0200 Subject: [PATCH] Use the long view when stdout isn't a terminal and a long grid view was requested (fixes #522) --- src/options/view.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/options/view.rs b/src/options/view.rs index 23e9a44..af936ce 100644 --- a/src/options/view.rs +++ b/src/options/view.rs @@ -80,7 +80,7 @@ impl Mode { // If the terminal width couldn’t be matched for some reason, such // as the program’s stdout being connected to a file, then - // fallback to the lines view. + // fallback to the lines or details view. else if matches.has(&flags::TREE)? { let details = details::Options { table: None, @@ -91,7 +91,10 @@ impl Mode { Ok(Mode::Details(details)) } - else { + else if matches.has(&flags::LONG)? { + let details = long()?; + Ok(Mode::Details(details)) + } else { let lines = lines::Options { icons: matches.has(&flags::ICONS)?, }; Ok(Mode::Lines(lines)) }