This commit is contained in:
Siddhartha Sahu 2025-06-26 06:27:03 +00:00 committed by GitHub
commit 8b11b16ab9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
179 changed files with 438 additions and 54 deletions

View file

@ -133,6 +133,17 @@ touch icons/man.1 --date=@0
touch icons/marked.md --date=@0
# END test_icons
# BEGIN test_dirs-ext
mkdir -p dirs-ext
mkdir dirs-ext/test
mkdir dirs-ext/abc
mkdir dirs-ext/01.city
mkdir dirs-ext/02.apple
touch dirs-ext/a.txt --date=@0
touch dirs-ext/abc.mp3 --date=@0
touch dirs-ext/ab --date=@0
# END test_dirs_ext
# BEGIN set date
touch --date=@0 ./*;
# END set date

View file

@ -288,14 +288,15 @@ impl SortField {
order => order,
},
Self::Extension(ABCabc) => match a.ext.cmp(&b.ext) {
Ordering::Equal => natord::compare(&a.name, &b.name),
order => order,
},
Self::Extension(AaBbCc) => match a.ext.cmp(&b.ext) {
Ordering::Equal => natord::compare_ignore_case(&a.name, &b.name),
order => order,
Self::Extension(case) => {
// Ignore extensions for directories when sorting.
let left = if a.is_directory() { &None } else { &a.ext };
let right = if b.is_directory() { &None } else { &b.ext };
match (left.cmp(right), case) {
(Ordering::Equal, ABCabc) => natord::compare(&a.name, &b.name),
(Ordering::Equal, AaBbCc) => natord::compare_ignore_case(&a.name, &b.name),
(order, _) => order,
}
},
Self::NameMixHidden(ABCabc) => natord::compare(

View file

@ -0,0 +1 @@
01.city 02.apple abc test ab abc.mp3 a.txt

View file

@ -0,0 +1,2 @@
bin.name = "eza"
args = "tests/itest --sort=extension --group-directories-first"

View file

View file

@ -0,0 +1 @@
01.city 02.apple ab abc test abc.mp3 a.txt

2
tests/cmd/sort-ext.toml Normal file
View file

@ -0,0 +1,2 @@
bin.name = "eza"
args = "tests/itest --sort=extension"

View file

@ -1,3 +1,4 @@
drwxr-xr-x - nixbld 1 Jan 1970 dirs-ext
drwxr-xr-x - nixbld 1 Jan 1970 git
drwxr-xr-x - nixbld 1 Jan 1970 grid
drwxr-xr-x - nixbld 1 Jan 1970 group

View file

@ -1,3 +1,4 @@
- dirs-ext
- git
- grid
- group

View file

@ -1,3 +1,4 @@
drwxr-xr-x - - nixbld 1 Jan 1970 dirs-ext
drwxr-xr-x - - nixbld 1 Jan 1970 git
drwxr-xr-x - - nixbld 1 Jan 1970 grid
drwxr-xr-x - - nixbld 1 Jan 1970 group

View file

@ -1,3 +1,4 @@
drwxr-xr-x - nixbld 1 Jan 1970 dirs-ext
drwxr-xr-x - nixbld 1 Jan 1970 git
drwxr-xr-x - nixbld 1 Jan 1970 grid
drwxr-xr-x - nixbld 1 Jan 1970 group

View file

@ -1,3 +1,4 @@
- dirs-ext
- git
- grid
- group

View file

@ -1,3 +1,4 @@
drwxr-xr-x - nixbld 1 Jan 1970 dirs-ext
drwxr-xr-x - nixbld 1 Jan 1970 git
drwxr-xr-x - nixbld 1 Jan 1970 grid
drwxr-xr-x - nixbld 1 Jan 1970 group

View file

@ -1,3 +1,4 @@
drwxr-xr-x - nixbld 1 Jan 1970 dirs-ext
drwxr-xr-x - nixbld 1 Jan 1970 git
drwxr-xr-x - nixbld 1 Jan 1970 grid
drwxr-xr-x - nixbld 1 Jan 1970 group

View file

@ -1,3 +1,4 @@
drwxr-xr-x - nixbld 1 Jan 1970 dirs-ext
drwxr-xr-x - nixbld 1 Jan 1970 git
drwxr-xr-x - nixbld 1 Jan 1970 grid
drwxr-xr-x - nixbld 1 Jan 1970 group

View file

@ -1,3 +1,4 @@
drwxr-xr-x - nixbld 1 Jan 1970 dirs-ext
drwxr-xr-x - nixbld 1 Jan 1970 git
drwxr-xr-x - nixbld 1 Jan 1970 grid
drwxr-xr-x - nixbld 1 Jan 1970 group

View file

@ -1,4 +1,5 @@
Permissions Size User Date Modified Name
drwxr-xr-x - nixbld 1 Jan 1970 dirs-ext
drwxr-xr-x - nixbld 1 Jan 1970 git
drwxr-xr-x - nixbld 1 Jan 1970 grid
drwxr-xr-x - nixbld 1 Jan 1970 group

View file

@ -1,4 +1,5 @@
Size Name
- dirs-ext
- git
- grid
- group

View file

@ -1,3 +1,4 @@
drwxr-xr-x - nixbld 1 Jan 1970 dirs-ext
drwxr-xr-x - nixbld 1 Jan 1970 git
drwxr-xr-x - nixbld 1 Jan 1970 grid
drwxr-xr-x - nixbld 1 Jan 1970 group

View file

@ -1,3 +1,4 @@
6 dirs-ext
12 git
1002 grid
2 group
@ -8,6 +9,23 @@
3 symlinks
2 time
tests/test_dir/dirs-ext:
2 01.city
2 02.apple
1 a.txt
1 ab
2 abc
1 abc.mp3
2 test
tests/test_dir/dirs-ext/01.city:
tests/test_dir/dirs-ext/02.apple:
tests/test_dir/dirs-ext/abc:
tests/test_dir/dirs-ext/test:
tests/test_dir/git:
3 001
3 002

View file

@ -1,3 +1,4 @@
drwxr-xr-x - nixbld 1 Jan 1970 dirs-ext
drwxr-xr-x - nixbld 1 Jan 1970 git
drwxr-xr-x - nixbld 1 Jan 1970 grid
drwxr-xr-x - nixbld 1 Jan 1970 group

View file

@ -1,3 +1,4 @@
0755 drwxr-xr-x - nixbld 1 Jan 1970 dirs-ext
0755 drwxr-xr-x - nixbld 1 Jan 1970 git
0755 drwxr-xr-x - nixbld 1 Jan 1970 grid
0755 drwxr-xr-x - nixbld 1 Jan 1970 group

View file

@ -1,3 +1,4 @@
dirs-ext
git
grid
group

View file

@ -1,3 +1,4 @@
drwxr-xr-x - nixbld 55 years dirs-ext
drwxr-xr-x - nixbld 55 years git
drwxr-xr-x - nixbld 55 years grid
drwxr-xr-x - nixbld 55 years group

View file

@ -1,3 +1,4 @@
dirs-ext
git
grid
group

View file

@ -1,3 +1,4 @@
dirs-ext
git
grid
group
@ -8,6 +9,20 @@ specials
symlinks
time
tests/test_dir/dirs-ext:
01.city
02.apple
abc
test
tests/test_dir/dirs-ext/01.city:
tests/test_dir/dirs-ext/02.apple:
tests/test_dir/dirs-ext/abc:
tests/test_dir/dirs-ext/test:
tests/test_dir/git:
001
002

View file

@ -1,3 +1,4 @@
dirs-ext
git
grid
group
@ -8,6 +9,20 @@ specials
symlinks
time
tests/test_dir/dirs-ext:
01.city
02.apple
abc
test
tests/test_dir/dirs-ext/01.city:
tests/test_dir/dirs-ext/02.apple:
tests/test_dir/dirs-ext/abc:
tests/test_dir/dirs-ext/test:
tests/test_dir/git:
001
002

View file

@ -1,3 +1,4 @@
dirs-ext
git
grid
group

View file

@ -1,3 +1,4 @@
dirs-ext
git
grid
group
@ -8,6 +9,23 @@ specials
symlinks
time
tests/test_dir/dirs-ext:
01.city
02.apple
a.txt
ab
abc
abc.mp3
test
tests/test_dir/dirs-ext/01.city:
tests/test_dir/dirs-ext/02.apple:
tests/test_dir/dirs-ext/abc:
tests/test_dir/dirs-ext/test:
tests/test_dir/git:
001
002

View file

@ -1,3 +1,4 @@
dirs-ext
git
grid
group
@ -8,6 +9,23 @@ specials
symlinks
time
tests/test_dir/dirs-ext:
01.city
02.apple
a.txt
ab
abc
abc.mp3
test
tests/test_dir/dirs-ext/01.city:
tests/test_dir/dirs-ext/02.apple:
tests/test_dir/dirs-ext/abc:
tests/test_dir/dirs-ext/test:
tests/test_dir/git:
001
002

View file

@ -1,4 +1,12 @@
tests/test_dir
├── dirs-ext
│ ├── 01.city
│ ├── 02.apple
│ ├── a.txt
│ ├── ab
│ ├── abc
│ ├── abc.mp3
│ └── test
├── git
│ ├── 001
│ │ ├── file_000

View file

@ -1,4 +1,12 @@
tests/test_dir
├── dirs-ext
│ ├── 01.city
│ ├── 02.apple
│ ├── a.txt
│ ├── ab
│ ├── abc
│ ├── abc.mp3
│ └── test
├── git
│ ├── 001
│ │ ├── file_000

View file

@ -1,3 +1,4 @@
dirs-ext
git
grid
group

View file

@ -1,9 +1,10 @@
drwxr-xr-x - nixbld 1 Jan 1970 dirs-ext
drwxr-xr-x - nixbld 1 Jan 1970 icons
drwxr-xr-x - nixbld 1 Jan 1970 time
drwxr-xr-x - nixbld 1 Jan 1970 size
drwxr-xr-x - nixbld 1 Jan 1970 group
drwxr-xr-x - nixbld 1 Jan 1970 perms
drwxr-xr-x - nixbld 1 Jan 1970 symlinks
drwxr-xr-x - nixbld 1 Jan 1970 specials
drwxr-xr-x - nixbld 1 Jan 1970 git
drwxr-xr-x - nixbld 1 Jan 1970 group
drwxr-xr-x - nixbld 1 Jan 1970 grid

View file

@ -1,3 +1,4 @@
dirs-ext
git
grid
group

View file

@ -1,3 +1,4 @@
dirs-ext
git
grid
group

View file

@ -1,9 +1,10 @@
drwxr-xr-x - nixbld 1 Jan 1970 dirs-ext
drwxr-xr-x - nixbld 1 Jan 1970 icons
drwxr-xr-x - nixbld 1 Jan 1970 time
drwxr-xr-x - nixbld 1 Jan 1970 size
drwxr-xr-x - nixbld 1 Jan 1970 group
drwxr-xr-x - nixbld 1 Jan 1970 perms
drwxr-xr-x - nixbld 1 Jan 1970 symlinks
drwxr-xr-x - nixbld 1 Jan 1970 specials
drwxr-xr-x - nixbld 1 Jan 1970 git
drwxr-xr-x - nixbld 1 Jan 1970 group
drwxr-xr-x - nixbld 1 Jan 1970 grid

View file

@ -1,3 +1,4 @@
dirs-ext
git
grid
group

View file

@ -1,3 +1,4 @@
drwxr-xr-x - nixbld 1 Jan 1970 dirs-ext
drwxr-xr-x - nixbld 1 Jan 1970 git
drwxr-xr-x - nixbld 1 Jan 1970 grid
drwxr-xr-x - nixbld 1 Jan 1970 group

View file

@ -1,3 +1,4 @@
drwxr-xr-x - nixbld 1 Jan 1970 dirs-ext
drwxr-xr-x - nixbld 1 Jan 1970 git
drwxr-xr-x - nixbld 1 Jan 1970 grid
drwxr-xr-x - nixbld 1 Jan 1970 group

View file

@ -1,3 +1,4 @@
dirs-ext
git
grid
group

View file

@ -1,3 +1,4 @@
dirs-ext
git
grid
group

View file

@ -1,9 +1,10 @@
drwxr-xr-x - nixbld 1 Jan 1970 dirs-ext
drwxr-xr-x - nixbld 1 Jan 1970 icons
drwxr-xr-x - nixbld 1 Jan 1970 time
drwxr-xr-x - nixbld 1 Jan 1970 size
drwxr-xr-x - nixbld 1 Jan 1970 group
drwxr-xr-x - nixbld 1 Jan 1970 perms
drwxr-xr-x - nixbld 1 Jan 1970 symlinks
drwxr-xr-x - nixbld 1 Jan 1970 specials
drwxr-xr-x - nixbld 1 Jan 1970 git
drwxr-xr-x - nixbld 1 Jan 1970 group
drwxr-xr-x - nixbld 1 Jan 1970 grid

View file

@ -1,3 +1,4 @@
dirs-ext
git
grid
group

View file

@ -1,9 +1,10 @@
drwxr-xr-x - nixbld 1 Jan 1970 dirs-ext
drwxr-xr-x - nixbld 1 Jan 1970 icons
drwxr-xr-x - nixbld 1 Jan 1970 time
drwxr-xr-x - nixbld 1 Jan 1970 size
drwxr-xr-x - nixbld 1 Jan 1970 group
drwxr-xr-x - nixbld 1 Jan 1970 perms
drwxr-xr-x - nixbld 1 Jan 1970 symlinks
drwxr-xr-x - nixbld 1 Jan 1970 specials
drwxr-xr-x - nixbld 1 Jan 1970 git
drwxr-xr-x - nixbld 1 Jan 1970 group
drwxr-xr-x - nixbld 1 Jan 1970 grid

View file

@ -1,3 +1,4 @@
dirs-ext
git
grid
group

View file

@ -1 +1 @@
git grid group icons perms size specials symlinks time
dirs-ext git grid group icons perms size specials symlinks time

View file

@ -3,6 +3,7 @@ drwxr-xr-x - nixbld 1 Jan 1970 group
drwxr-xr-x - nixbld 1 Jan 1970 perms
drwxr-xr-x - nixbld 1 Jan 1970 size
drwxr-xr-x - nixbld 1 Jan 1970 time
drwxr-xr-x - nixbld 1 Jan 1970 dirs-ext
drwxr-xr-x - nixbld 1 Jan 1970 symlinks
drwxr-xr-x - nixbld 1 Jan 1970 git
drwxr-xr-x - nixbld 1 Jan 1970 icons

View file

@ -1,3 +1,4 @@
dirs-ext/
git/
grid/
group/

View file

@ -1,3 +1,4 @@
dirs-ext
git
grid
group

View file

@ -1,3 +1,4 @@
dirs-ext
git
grid
group

View file

@ -1,4 +1,12 @@
tests/test_dir
├── dirs-ext
│ ├── 01.city
│ ├── 02.apple
│ ├── a.txt
│ ├── ab
│ ├── abc
│ ├── abc.mp3
│ └── test
├── git
│ ├── 001
│ │ ├── file_000

View file

@ -1,3 +1,4 @@
dirs-ext
git
grid
group

View file

@ -1,3 +1,4 @@
dirs-ext
git
grid
group

View file

@ -1,4 +1,12 @@
tests/test_dir
├── dirs-ext
│ ├── 01.city
│ ├── 02.apple
│ ├── a.txt
│ ├── ab
│ ├── abc
│ ├── abc.mp3
│ └── test
├── git
│ ├── 001
│ ├── 002

View file

@ -1,3 +1,4 @@
git icons specials
grid perms symlinks
group size time
dirs-ext icons symlinks
git perms time
grid size
group specials

View file

@ -1,3 +1,4 @@
dirs-ext
git
grid
group

View file

@ -1,3 +1,4 @@
drwxr-xr-x - nixbld 1 Jan 1970 dirs-ext
drwxr-xr-x - nixbld 1 Jan 1970 git
drwxr-xr-x - nixbld 1 Jan 1970 grid
drwxr-xr-x - nixbld 1 Jan 1970 group

View file

@ -1,8 +1,10 @@
git time
grid
group
icons
perms
size
specials
symlinks
dirs-ext
git
grid
group
icons
perms
size
specials
symlinks
time

View file

@ -1,3 +1,4 @@
dirs-ext
git
grid
group

View file

@ -1,3 +1,4 @@
dirs-ext
git
grid
group

View file

@ -1,3 +1,4 @@
dirs-ext
git
grid
group

View file

@ -1,3 +1,4 @@
dirs-ext
git
grid
group

View file

@ -1,3 +1,4 @@
dirs-ext
git
grid
group

View file

@ -1,3 +1,4 @@
drwxr-xr-x - nixbld 1 Jan 1970 dirs-ext
drwxr-xr-x - nixbld 1 Jan 1970 git
drwxr-xr-x - nixbld 1 Jan 1970 grid
drwxr-xr-x - nixbld 1 Jan 1970 group

View file

@ -1,3 +1,4 @@
drwxr-xr-x - nixbld 1 Jan 1970 dirs-ext
drwxr-xr-x - nixbld 1 Jan 1970 git
drwxr-xr-x - nixbld 1 Jan 1970 grid
drwxr-xr-x - nixbld 1 Jan 1970 group

View file

@ -1,3 +1,4 @@
drwxr-xr-x - nixbld 1 Jan 1970 dirs-ext
drwxr-xr-x - nixbld 1 Jan 1970 git
drwxr-xr-x - nixbld 1 Jan 1970 grid
drwxr-xr-x - nixbld 1 Jan 1970 group

View file

@ -1,3 +1,4 @@
dirs-ext
git
grid
group

View file

@ -1,3 +1,4 @@
dirs-ext
git
grid
group

View file

@ -1,3 +1,4 @@
dirs-ext
git
grid
group

View file

@ -1,4 +1,12 @@
tests/test_dir
├── dirs-ext
│ ├── 01.city
│ ├── 02.apple
│ ├── a.txt
│ ├── ab
│ ├── abc
│ ├── abc.mp3
│ └── test
├── git
│ ├── 001
│ │ ├── file_000

View file

@ -1,9 +1,10 @@
drwxr-xr-x - nixbld 1 Jan 1970 dirs-ext
drwxr-xr-x - nixbld 1 Jan 1970 icons
drwxr-xr-x - nixbld 1 Jan 1970 time
drwxr-xr-x - nixbld 1 Jan 1970 size
drwxr-xr-x - nixbld 1 Jan 1970 group
drwxr-xr-x - nixbld 1 Jan 1970 perms
drwxr-xr-x - nixbld 1 Jan 1970 symlinks
drwxr-xr-x - nixbld 1 Jan 1970 specials
drwxr-xr-x - nixbld 1 Jan 1970 git
drwxr-xr-x - nixbld 1 Jan 1970 group
drwxr-xr-x - nixbld 1 Jan 1970 grid

View file

@ -1,4 +1,12 @@
tests/test_dir
├── dirs-ext
│ ├── 01.city
│ ├── 02.apple
│ ├── a.txt
│ ├── ab
│ ├── abc
│ ├── abc.mp3
│ └── test
├── git
│ ├── 001
│ │ ├── file_000

View file

@ -1,3 +1,4 @@
dirs-ext
git
grid
group

View file

@ -1,3 +1,4 @@
dirs-ext
git
grid
group

View file

@ -1,4 +1,12 @@
tests/test_dir
├── dirs-ext
│ ├── 01.city
│ ├── 02.apple
│ ├── a.txt
│ ├── ab
│ ├── abc
│ ├── abc.mp3
│ └── test
├── git
│ ├── 001
│ │ ├── file_000

View file

@ -1,3 +1,4 @@
[CWD]/tests/test_dir/dirs-ext
[CWD]/tests/test_dir/git
[CWD]/tests/test_dir/grid
[CWD]/tests/test_dir/group

View file

@ -1,3 +1,4 @@
dirs-ext
git
grid
group

View file

@ -1,3 +1,4 @@
dirs-ext
git
grid
group

View file

@ -1,3 +1,4 @@
dirs-ext
git
grid
group

View file

@ -1,3 +1,4 @@
dirs-ext
git
grid
group

View file

@ -1,3 +1,4 @@
dirs-ext
git
grid
group

View file

@ -1,3 +1,4 @@
dirs-ext
git
grid
group

View file

@ -1,3 +1,4 @@
dirs-ext
git
grid
group

View file

@ -1,3 +1,4 @@
drwxr-xr-x - nixbld 1 Jan 1970 dirs-ext
drwxr-xr-x - nixbld 1 Jan 1970 git
drwxr-xr-x - nixbld 1 Jan 1970 grid
drwxr-xr-x - nixbld 1 Jan 1970 group

View file

@ -1,3 +1,4 @@
dirs-ext
git
grid
group

View file

@ -1,3 +1,4 @@
dirs-ext
git
grid
group
@ -8,6 +9,23 @@ specials
symlinks
time
tests/test_dir/dirs-ext:
01.city
02.apple
a.txt
ab
abc
abc.mp3
test
tests/test_dir/dirs-ext/01.city:
tests/test_dir/dirs-ext/02.apple:
tests/test_dir/dirs-ext/abc:
tests/test_dir/dirs-ext/test:
tests/test_dir/git:
001
002

View file

@ -1,3 +1,4 @@
dirs-ext
git
grid
group

View file

@ -1,3 +1,4 @@
dirs-ext
git
grid
group

View file

@ -1,3 +1,4 @@
drwxr-xr-x - nixbld 1 Jan 1970 dirs-ext
drwxr-xr-x - nixbld 1 Jan 1970 git
drwxr-xr-x - nixbld 1 Jan 1970 grid
drwxr-xr-x - nixbld 1 Jan 1970 group

View file

@ -1,3 +1,4 @@
dirs-ext
git
grid
group

View file

@ -1,3 +1,4 @@
dirs-ext
git
grid
group

View file

@ -1,3 +1,4 @@
dirs-ext
git
grid
group

View file

@ -1,3 +1,4 @@
drwxr-xr-x - nixbld 1 Jan 1970 dirs-ext
drwxr-xr-x - nixbld 1 Jan 1970 git
drwxr-xr-x - nixbld 1 Jan 1970 grid
drwxr-xr-x - nixbld 1 Jan 1970 group

View file

@ -1,3 +1,4 @@
dirs-ext
git
grid
group

View file

@ -1,3 +1,4 @@
dirs-ext
git
grid
group

View file

@ -1,3 +1,4 @@
 dirs-ext
 git
 grid
 group

View file

@ -1,9 +1,10 @@
drwxr-xr-x - nixbld 1 Jan 1970 dirs-ext
drwxr-xr-x - nixbld 1 Jan 1970 icons
drwxr-xr-x - nixbld 1 Jan 1970 time
drwxr-xr-x - nixbld 1 Jan 1970 size
drwxr-xr-x - nixbld 1 Jan 1970 group
drwxr-xr-x - nixbld 1 Jan 1970 perms
drwxr-xr-x - nixbld 1 Jan 1970 symlinks
drwxr-xr-x - nixbld 1 Jan 1970 specials
drwxr-xr-x - nixbld 1 Jan 1970 git
drwxr-xr-x - nixbld 1 Jan 1970 group
drwxr-xr-x - nixbld 1 Jan 1970 grid

View file

@ -7,3 +7,4 @@ icons
group
grid
git
dirs-ext

Some files were not shown because too many files have changed in this diff Show more