Fix --list-details on FreeBSD

This commit is contained in:
Tobias Kortkamp 2020-04-16 19:44:10 +02:00 committed by David Peter
parent fe00860b87
commit 4b5e8941a7

View file

@ -175,11 +175,11 @@ fn run() -> Result<ExitCode> {
}; };
let cmd: Vec<&str> = if cfg!(unix) { let cmd: Vec<&str> = if cfg!(unix) {
if !cfg!(target_os = "macos") { if !cfg!(any(target_os = "macos", target_os = "dragonfly", target_os = "freebsd")) {
// Non-MacOS Unix // Assume ls is GNU ls
gnu_ls("ls") gnu_ls("ls")
} else { } else {
// MacOS // MacOS, DragonFlyBSD, FreeBSD
use std::process::{Command, Stdio}; use std::process::{Command, Stdio};
// Use GNU ls, if available (support for --color=auto, better LS_COLORS support) // Use GNU ls, if available (support for --color=auto, better LS_COLORS support)
@ -194,9 +194,9 @@ fn run() -> Result<ExitCode> {
gnu_ls("gls") gnu_ls("gls")
} else { } else {
let mut cmd = vec![ let mut cmd = vec![
"ls", // MacOS version of ls "ls", // BSD version of ls
"-l", // long listing format "-l", // long listing format
"-h", // '--human-readable' is not available on MacOS, '-h' is "-h", // '--human-readable' is not available, '-h' is
"-d", // '--directory' is not available, but '-d' is "-d", // '--directory' is not available, but '-d' is
]; ];