mirror of
https://github.com/EnumeratedDev/bpm.git
synced 2026-09-16 02:26:12 +00:00
Sort packages by name correctly in 'list' subcommand
This commit is contained in:
@@ -370,6 +370,15 @@ func showPackageList() {
|
||||
|
||||
switch sortPackages {
|
||||
case "", "name":
|
||||
slices.SortFunc(installedPackages, func(a, b struct {
|
||||
pkgInfo bpmlib.PackageInfo
|
||||
installedSize int64
|
||||
}) int {
|
||||
return strings.Compare(a.pkgInfo.Name, b.pkgInfo.Name)
|
||||
})
|
||||
slices.SortFunc(databaseEntries, func(a, b *bpmlib.BPMDatabaseEntry) int {
|
||||
return strings.Compare(a.Info.Name, b.Info.Name)
|
||||
})
|
||||
case "size":
|
||||
slices.SortFunc(installedPackages, func(a, b struct {
|
||||
pkgInfo bpmlib.PackageInfo
|
||||
|
||||
Reference in New Issue
Block a user