diff --git a/src/main.rs b/src/main.rs index 9c52867..969ffbc 100644 --- a/src/main.rs +++ b/src/main.rs @@ -161,9 +161,9 @@ fn run() -> Result { 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 { 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." )); }; diff --git a/tests/tests.rs b/tests/tests.rs index 360d3db..e1ab05c 100644 --- a/tests/tests.rs +++ b/tests/tests.rs @@ -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"]); +}