mirror of
https://git.savannah.gnu.org/git/coreutils.git
synced 2025-09-10 07:59:52 +02:00
ls: add support for explicit file name sorting
Support overriding previous sorting options with an explicit --sort=name option. * doc/coreutils.texi (ls invocation): Document the new option. * src/ls.c (usage): Likewise. (sort_args): Add the "name" entry, and sort to be consistent with the ordering presented in --help. * tests/ls/ls-time.sh: Add test cases. * NEWS: Mention the new feature. Suggested by: Tzvetelin Katchov
This commit is contained in:
@@ -37,8 +37,10 @@ touch -m -d "$t2" B || framework_failure_ # Capital to distinguish name sort
|
||||
touch -m -d "$t1" c || framework_failure_
|
||||
|
||||
# Check default name sorting works
|
||||
set $(ls a B c)
|
||||
test "$*" = 'B a c' || fail=1
|
||||
for def_sort in '' '--sort=name' '-U --sort=name' '--sort-name -t'; do
|
||||
set $(ls $def_sort a B c)
|
||||
test "$*" = 'B a c' || fail=1
|
||||
done
|
||||
|
||||
touch -a -d "$u3" c || framework_failure_
|
||||
touch -a -d "$u2" B || framework_failure_
|
||||
|
||||
Reference in New Issue
Block a user