Use the long view when stdout isn't a terminal and a long grid view was requested (fixes #522)

This commit is contained in:
FliegendeWurst 2019-10-12 11:58:31 +02:00
parent b5b731071c
commit 6010ed5213
No known key found for this signature in database
GPG Key ID: CA38E82B54B32A88

View File

@ -80,7 +80,7 @@ impl Mode {
// If the terminal width couldnt be matched for some reason, such
// as the programs 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))
}