Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ls: implement --group-directories-first #3550

Merged
merged 4 commits into from
May 22, 2022
Merged

Conversation

thomasqueirozb
Copy link
Contributor

Closes #3519

@sylvestre
Copy link
Contributor

Cool stuff. Could you please add tests? thanks

@thomasqueirozb
Copy link
Contributor Author

thomasqueirozb commented May 21, 2022

Cool stuff. Could you please add tests? thanks

I did it but I went down a rabbit hole. I found out that ls -a doesn't work the same as the GNU version. The . and .. directories are always first, no matter what. If sorts are applied, -r is specified or --group-directories-first is used, the location of . and .. shouldn't always be on the top.

Now with the changes I made it mostly behaves the same (I think). But this created one unfortunate side effect: ls -a1v now places .. at the end of the list and . at the beginning. The GNU version places both . and .. at the beginning. I couldn't find an easy fix for this so I just changed the test.

@sylvestre
Copy link
Contributor

I went down a rabbit hole.

Welcome to the Rust/coreutils ;)

@thomasqueirozb
Copy link
Contributor Author

An unrelated test failed. Maybe re-run that step of the CI?

@sylvestre
Copy link
Contributor

bravo
Warning: Congrats! The gnu test tests/ls/group-dirs is no longer failing!

@sylvestre sylvestre merged commit 887f49c into uutils:main May 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement ls --group-directories-first
2 participants