mirror of
https://github.com/packwiz/packwiz.git
synced 2025-04-19 13:06:30 +02:00
Tweak list output format, sort by lowercase name
This commit is contained in:
parent
1cd848264d
commit
66e9e1de78
@ -4,6 +4,7 @@ import (
|
||||
"fmt"
|
||||
"os"
|
||||
"sort"
|
||||
"strings"
|
||||
|
||||
"github.com/packwiz/packwiz/core"
|
||||
"github.com/spf13/cobra"
|
||||
@ -39,13 +40,13 @@ var listCmd = &cobra.Command{
|
||||
}
|
||||
|
||||
sort.Slice(mods, func(i, j int) bool {
|
||||
return mods[i].Name < mods[j].Name
|
||||
return strings.ToLower(mods[i].Name) < strings.ToLower(mods[j].Name)
|
||||
})
|
||||
|
||||
// Print mods
|
||||
if viper.GetBool("list.version") {
|
||||
for _, mod := range mods {
|
||||
fmt.Printf("%s\t[%s]\n", mod.Name, mod.FileName)
|
||||
fmt.Printf("%s (%s)\n", mod.Name, mod.FileName)
|
||||
}
|
||||
} else {
|
||||
for _, mod := range mods {
|
||||
|
Loading…
x
Reference in New Issue
Block a user