Do not show output of 'gls --version'

This commit is contained in:
sharkdp 2020-04-15 20:31:59 +02:00 committed by David Peter
parent 2685728695
commit 0f5500adfc
1 changed files with 7 additions and 2 deletions

View File

@ -176,10 +176,15 @@ fn run() -> Result<ExitCode> {
]
} else {
// MacOS
use std::process::Command;
use std::process::{Command, Stdio};
// Use GNU ls, if available
let gnu_ls_exists = Command::new("gls").arg("--version").status().is_ok();
let gnu_ls_exists = Command::new("gls")
.arg("--version")
.stdout(Stdio::null())
.stderr(Stdio::null())
.status()
.is_ok();
if gnu_ls_exists {
vec![