Skip to content

Commit

Permalink
Merge pull request #685 from jaakkor2/humansort
Browse files Browse the repository at this point in the history
Human sort channel list
  • Loading branch information
davidanthoff authored Jul 8, 2023
2 parents 2e3347d + 4a4b17a commit 6d899d3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ bstr = "1.0.1"
indoc = "2.0.1"
is-terminal = "0.4.7"
path-absolutize = "3"
human-sort = "0.2.2"

[target.'cfg(windows)'.dependencies]
windows = { version = "0.48.0", features = ["Win32_Foundation", "Win32_UI_Shell", "Win32_System_Console", "Services_Store", "Foundation", "Foundation_Collections", "Web_Http", "Storage_Streams",] }
Expand Down
3 changes: 2 additions & 1 deletion src/command_list.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ use cli_table::{
print_stdout, ColorChoice, Table, WithTitle,
};
use itertools::Itertools;
use human_sort::compare;

#[derive(Table)]
struct ChannelRow {
Expand All @@ -27,7 +28,7 @@ pub fn run_command_list(paths: &GlobalPaths) -> Result<()> {
version: i.1.version.clone(),
}
})
.sorted_by_key(|i| i.name.clone())
.sorted_by(|a, b| compare(&a.name, &b.name))
.collect();

print_stdout(
Expand Down

0 comments on commit 6d899d3

Please sign in to comment.