This commit is contained in:
sharkdp 2020-04-15 23:08:15 +02:00 committed by David Peter
parent 0b7febc3b6
commit 4287cddc00
2 changed files with 11 additions and 3 deletions

View File

@ -161,9 +161,9 @@ fn run() -> Result<ExitCode> {
Some(CommandTemplate::new_batch(args)?)
} else if matches.is_present("list-details") {
let color = matches.value_of("color").unwrap_or("auto");
#[allow(unused)]
let color_arg = ["--color=", color].concat();
#[allow(unused)]
let gnu_ls = |command_name| {
vec![
command_name,
@ -222,12 +222,12 @@ fn run() -> Result<ExitCode> {
gnu_ls("ls")
} else {
return Err(anyhow!(
"'fd --list-details' is not supported on this platform."
"'fd --list-details' is not supported on Windows unless GNU 'ls' is installed."
));
}
} else {
return Err(anyhow!(
"'fd --list-details' is not supported on Windows unless GNU 'ls' is installed."
"'fd --list-details' is not supported on this platform."
));
};

View File

@ -1558,3 +1558,11 @@ fn test_exec_invalid_utf8() {
b"test_\xFEinvalid\n",
);
}
#[test]
fn test_list_details() {
let te = TestEnv::new(DEFAULT_DIRS, DEFAULT_FILES);
// Make sure we can execute 'fd --list-details' without any errors.
te.assert_success_and_get_output(".", &["--list-details"]);
}