fix version sort for matching GNU ls (#843)

This commit is contained in:
juansc 2023-07-05 23:02:57 -07:00 committed by GitHub
parent 71156b8530
commit 4514713e9b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 15 additions and 5 deletions

View file

@ -36,6 +36,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Color theme is now expected to be in `$XDG/lsd/colors.yaml` by default from [peppidesu](https://github.com/peppidesu)
Legacy behaviour (`themes` folder) is marked as deprecated but is still supported.
[#749](https://github.com/lsd-rs/lsd/issues/749)
- Version sort option `-v, --versionsort` has been updated to match GNU version sort logic,
similar to `ls -v` and `sort -V` [#801](https://github.com/lsd-rs/lsd/issues/801) from [juansc](https://github.com/juansc)
## [0.23.1] - 2022-09-13

15
Cargo.lock generated
View file

@ -571,6 +571,7 @@ dependencies = [
"url",
"users",
"version_check",
"vsort",
"wild",
"windows",
"xattr",
@ -809,9 +810,9 @@ dependencies = [
[[package]]
name = "regex"
version = "1.5.5"
version = "1.7.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1a11647b6b25ff05a515cb92c365cec08801e83423a235b51e231e1808747286"
checksum = "8b1f693b24f6ac912f4893ef08244d70b6067480d2f1a46e950c9691e6749d1d"
dependencies = [
"aho-corasick",
"memchr",
@ -826,9 +827,9 @@ checksum = "6c230d73fb8d8c1b9c0b3135c5142a8acee3a0558fb8db5cf1cb65f8d7862132"
[[package]]
name = "regex-syntax"
version = "0.6.25"
version = "0.6.29"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f497285884f3fcff424ffc933e56d7cbca511def0c9831a7f9b5f6153e3cc89b"
checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1"
[[package]]
name = "remove_dir_all"
@ -1172,6 +1173,12 @@ version = "0.9.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f"
[[package]]
name = "vsort"
version = "0.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "84afa8e70fb599a53474f4d83c085bd9e8848d02b7a774c6f39ebcebbbfddd16"
[[package]]
name = "wait-timeout"
version = "0.2.0"

View file

@ -41,6 +41,7 @@ yaml-rust = "0.4.*"
serde = { version = "1.0", features = ["derive"] }
serde_yaml = "0.8"
url = "2.1.*"
vsort = "0.1.0"
[target."cfg(not(all(windows, target_arch = \"x86\", target_env = \"gnu\")))".dependencies]
# if ssl feature is enabled compilation will fail on arm-unknown-linux-gnueabihf and i686-pc-windows-gnu

View file

@ -1,7 +1,7 @@
use crate::flags::{DirGrouping, Flags, SortColumn, SortOrder};
use crate::meta::Meta;
use human_sort::compare;
use std::cmp::Ordering;
use vsort::compare;
pub type SortFn = fn(&Meta, &Meta) -> Ordering;