1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-28 11:37:44 +00:00

ls --dired: v9.5 --hyperlink is ignored if passed first

Manages cases like:
$ ls -R --dired --hyperlink a2
will show hyperlink
$ ls -R --hyperlink --dired a2
won't
This commit is contained in:
Sylvestre Ledru 2024-06-21 23:21:55 +02:00
parent da11981026
commit cd44a3d1fd
2 changed files with 33 additions and 4 deletions

View file

@ -3941,6 +3941,34 @@ fn test_ls_dired_implies_long() {
.stdout_contains("//DIRED-OPTIONS// --quoting-style");
}
#[test]
fn test_ls_dired_hyperlink() {
// we will have link but not the DIRED output
// note that the order matters
let scene = TestScenario::new(util_name!());
let at = &scene.fixtures;
at.mkdir("dir");
at.touch("dir/a");
scene
.ucmd()
.arg("--dired")
.arg("--hyperlink")
.arg("-R")
.succeeds()
.stdout_contains("file://")
.stdout_does_not_contain("//DIRED//");
// dired is passed after hyperlink
// so we will have DIRED output
scene
.ucmd()
.arg("--hyperlink")
.arg("--dired")
.arg("-R")
.succeeds()
.stdout_does_not_contain("file://")
.stdout_contains("//DIRED//");
}
#[test]
fn test_ls_dired_and_zero_are_incompatible() {
let scene = TestScenario::new(util_name!());