Skip to content

ls: unquoted names should be indented with a space if there is a quoted name#5740

Merged
cakebaker merged 5 commits intouutils:mainfrom
mtimaN:ls_indentation
Dec 29, 2023
Merged

ls: unquoted names should be indented with a space if there is a quoted name#5740
cakebaker merged 5 commits intouutils:mainfrom
mtimaN:ls_indentation

Conversation

@mtimaN
Copy link
Copy Markdown
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
Copy Markdown
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.

@github-actions
Copy link
Copy Markdown

GNU testsuite comparison:

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

@cakebaker
Copy link
Copy Markdown
Contributor

Ok, I removed the old commits from this branch.

@cakebaker cakebaker merged commit 21d09dd into uutils:main Dec 29, 2023
@cakebaker
Copy link
Copy Markdown
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