Ignore case when sorting services

This commit is contained in:
Christian Muehlhaeuser 2018-03-27 00:13:03 +02:00
parent ffdfbfb739
commit af7f650788
No known key found for this signature in database
GPG Key ID: BA4CF857DD4117E9
1 changed files with 2 additions and 1 deletions

View File

@ -3,6 +3,7 @@ package main
import ( import (
"fmt" "fmt"
"sort" "sort"
"strings"
"github.com/coreos/go-systemd/sdjournal" "github.com/coreos/go-systemd/sdjournal"
) )
@ -23,7 +24,7 @@ func serviceModel(specialServices, activeOnly bool) ([]ServiceItem, error) {
} }
sort.Slice(ts, func(i, j int) bool { sort.Slice(ts, func(i, j int) bool {
return ts[i].Name < ts[j].Name return strings.ToLower(ts[i].Name) < strings.ToLower(ts[j].Name)
}) })
model := []ServiceItem{} model := []ServiceItem{}