ls: resolve --dired by argument position - #14590
Open
ChihweiLHBird wants to merge 2 commits into
Open
ChihweiLHBird wants to merge 2 commits into
ChihweiLHBird wants to merge 2 commits into
Conversation
ChihweiLHBird
marked this pull request as draft
September 16, 2026 01:04
ChihweiLHBird
marked this pull request as ready for review
September 16, 2026 01:05
ChihweiLHBird
force-pushed
the
zhiwei/fix-ls-dired-last-wins
branch
2 times, most recently
from
September 16, 2026 01:25
19c5783 to
9791483
Compare
|
GNU testsuite comparison: |
ChihweiLHBird
force-pushed
the
zhiwei/fix-ls-dired-last-wins
branch
from
September 16, 2026 15:42
9791483 to
0cbd455
Compare
Signed-off-by: Zhiwei Liang <zhiwei.liang@zliang.me>
Signed-off-by: Zhiwei Liang <zhiwei.liang@zliang.me>
ChihweiLHBird
force-pushed
the
zhiwei/fix-ls-dired-last-wins
branch
from
September 17, 2026 02:29
0cbd455 to
335e70b
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
--diredforced long format no matter what followed it. GNU treats-Dlike-g,-oand-nthat a later-C,-x,-mor--format=wins, and dired output is emitted only when the final format is long and no--hyperlinkcomes after the last-D.Before this PR,
uutilscould not see where-Dwas.clap'soverrides_withwith--format=and--hyperlinkdeleted the flag from the matches, and the argv scan added to work around that (is_dired_arg_present) also matched files literally named-D.Behaviour Comparing to GNU
One file
a, stdout a pipels --dired -C aals --dired -C --zero aa\0ls --dired --hyperlink=never a//DIRED////DIRED//ls -CD --hyperlink als -lD --format=vertical -l a//DIRED////DIRED//One file literally named
-D, stdout a pipels -- -D-Dls --zero -- -D-D\0Files
aaandbb,bbaccessed more recently, stdout a pipels --dired -C -u aa bb//DIRED//, name orderbb aa(atime order)One file
a b, stdout a terminalls --dired 'a b'a b,--quoting-style=literal'a b',--quoting-style=shell-escape