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: unquoted names should be indented with a space if there is a quoted name #5740

Merged
merged 5 commits into from Dec 29, 2023

Conversation

mtimaN
Copy link
Contributor

@mtimaN mtimaN commented Dec 28, 2023

Issue #5632 fix.

In short, I added a boolean variable quoted which is true if at least one file name is displayed between quotes. If so, all unquoted filenames are formatted so that they have an extra leading space, as GNU's ls does.

Unfortunately I couldn't find a way to write unit tests for this functionality because ls formats output differently when it's not stdout. I tried using different flags ("-C", "--quoting-style", "-T") but couldn't find a way to make ls format properly.

@mtimaN
Copy link
Contributor Author

mtimaN commented Dec 28, 2023

Sorry for the old commits :)
I worked on main yesterday (I'm kind of a beginner). I think deleting my fork and creating a new one will solve this so I will keep this in mind for future PRs.

Copy link

GNU testsuite comparison:

Skipping an intermittent issue tests/tail/inotify-dir-recreate (passes in this run but fails in the 'main' branch)

src/uu/ls/src/ls.rs Outdated Show resolved Hide resolved
@cakebaker
Copy link
Contributor

Ok, I removed the old commits from this branch.

@cakebaker cakebaker merged commit 21d09dd into uutils:main Dec 29, 2023
55 of 56 checks passed
@cakebaker
Copy link
Contributor

Thanks :)

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.

ls: unquoted names should be indented with a space if there is a quoted name
2 participants