main: change account order sort

Sort the accounts based on case insensitive names.

Signed-off-by: Tobias Wölfel <tobias.woelfel@mailbox.org>
Acked-by: Robin Jarry <robin@jarry.cc>
This commit is contained in:
Tobias Wölfel 2022-09-07 08:31:12 +02:00 committed by Robin Jarry
parent 1aa4fb9bff
commit f6a7a64fa7
3 changed files with 3 additions and 3 deletions

View file

@ -107,7 +107,7 @@ func buildInfo() string {
func usage(msg string) {
fmt.Fprintln(os.Stderr, msg)
fmt.Fprintln(os.Stderr, "usage: aerc [-v] [-a <account-name>] [mailto:...]")
fmt.Fprintln(os.Stderr, "usage: aerc [-v] [-a <account-name[,account-name>] [mailto:...]")
os.Exit(1)
}

View file

@ -365,7 +365,7 @@ func loadAccountConfig(path string, accts []string) ([]AccountConfig, error) {
return nil, errors.New("account(s) not found")
}
sort.Slice(accounts, func(i, j int) bool {
return accts[i] < accts[j]
return strings.ToLower(accts[i]) < strings.ToLower(accts[j])
})
}
return accounts, nil